Answers for "where with find in laravel"

PHP
3

laravel find by

// Retrieve a model by its primary key...
$flight = AppFlight::find(1);

// Retrieve the first model matching the query constraints...
$flight = AppFlight::where('active', 1)->first();

// Shorthand for retrieving the first model matching the query constraints...
$flight = AppFlight::firstWhere('active', 1);
Posted by: Guest on September-11-2020
0

laravel where in

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

Browse Popular Code Answers by Language