Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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);
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #laravel #find
ADD COMMENT
Topic
Name
9+4 =