Laravel éloquent éloquent de DB
$res=User::where('id',$id)->delete();
Disturbed Dunlin
$res=User::where('id',$id)->delete();
Product::onlyTrashed()->find(2)->forceDelete();
DB::table('users')->where('votes', '>', 100)->delete();
php artisan make:model Flight
use App\Models\Flight;
$flight = Flight::find(1);
$flight->delete();
// If there's a flight from Oakland to San Diego, set the price to $99.
// If no matching model exists, create one.
$flight = App\Models\Flight::updateOrCreate(
['departure' => 'Oakland', 'destination' => 'San Diego'],
['price' => 99, 'discounted' => 1]
);