Level 7
Try this:
Picture::where('filename', $filename)->delete();
If you have the model already in a variable, then:
$picture->delete();
3 likes
Hi .. i am trying to delete a record, but not through the primary key.. Im doing the following ;
$picture=Picture::where("filename","=",$filename);
$picture->delete;
The record is never deleted, my assumption is that laravel will only allow the delete if I use a key instead of a normal column... What am I missing? thanks in advance #newbie
Try this:
Picture::where('filename', $filename)->delete();
If you have the model already in a variable, then:
$picture->delete();
Please or to participate in this conversation.