Answers for "laravel model::find"

PHP
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
0

laravel model where

$post = Post::where('id', $id);

$users = DB::table('users')->whereIn('id', array(1, 2, 3))->get();
Posted by: Guest on August-19-2021
0

laravel find query

php artisan make:model Flight --migration

php artisan make:model Flight -m
Posted by: Guest on October-08-2020

Browse Popular Code Answers by Language