Answers for "delete query in laravel eloquent"

PHP
2

laravel eloquent remove from db

$res=User::where('id',$id)->delete();
Posted by: Guest on November-05-2020
6

laravel create or update

// 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]
);
Posted by: Guest on September-27-2020
1

laravel query with trashed

$user->roles()->withTrashed()->get();
Posted by: Guest on June-19-2020
0

Laravel eloquent delete

use App\Models\Flight;

$flight = Flight::find(1);

$flight->delete();
Posted by: Guest on July-24-2021

Code answers related to "delete query in laravel eloquent"

Browse Popular Code Answers by Language