Skip to content
Advertisement

Tag: laravel-5.2

Laravel delete() static call

I got this error: Non-static method IlluminateDatabaseEloquentModel::delete() should not be called statically, assuming $this from incompatible context Here is the code in my controller: Can someone explain what I am doing wrong and how to call it correctly? Answer You have this: But you should be doing this:

Delete method with Sweet Alert in Laravel

I’m testing a method using Sweet Alert, to improve the messages issued by the Javascript alert method with the laravel framework. 1 – I downloaded the files sweetalert.css and sweetalert.min.js. 2 – So I connect the files from app.blade.php 3 – I created the delete button using the onclick event of Javascript and the following Sweet Alert function: 4 –

laravel 5.2 How to get route parameter in blade?

this is my url http://project.dev/blogs/image-with-article so, here I need the parameter image-with-article in my blade to display which is a parameter named slug here is in my routes file I need the slug paramter in blade. Answer I’m not sure what you mean. If you’re trying to construct the route in a Blade template, use If you’re trying to access

Laravel Eloquent – get last insert of related model

I have a relationship between two models: Terminal and terminalRent. A Terminal can have many terminalRents. I want to get the last Rent for a specific Terminal. When using where() it will reflect those on the Modal hoewever I want to get the last record for terminalRent in relation to the specific terminal. $id is the Id of the terminal

Advertisement