Laravel 5.1 Delete a row from database
The ::find($id)
method expects $id
to be a number, the primary key of the row you want to find.
If you want to delete a row by name, you should use the following code:
category::where('name', $name)->delete();