Skip to content
Advertisement

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:

JavaScript

Can someone explain what I am doing wrong and how to call it correctly?

Advertisement

Answer

You have this:

JavaScript

But you should be doing this:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement