I want to do a delete by id with the ORM of Laravel , and from what I've read it's not possible, and it should be done a way similar to this one.
File::find($code)->delete();
or
$file = File::find($code);
$file->delete();
in both cases it throws me an error Call to a member function delete () on null
The fact is that I deleted the database record.
Could someone tell me what I'm doing wrong or if I left something?