Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

It's more or less the same. You could also use

Project::findOrFail($id)->delete();
Project::findOrFail($id)->destroy($id);

$go = Project::findOrFail($id);
$go->destroy($id);

There's probably more ways to do that but you get the idea...

Last updated 2 years ago.
0

Destroy lets you optionally pass an array of id's to delete.

Both ultimately call delete() on the model instance, if you follow the API trail.

http://laravel.com/api/source-class-Illuminate.Database.Eloquent.Model.html#675 http://laravel.com/api/source-class-Illuminate.Database.Eloquent.Model.html#742

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Sharping sharping Joined 28 Jun 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.