laravel eloquent get first record code example
Example 1: laravel get first record
'First email'
User::whereEmail($email)->first();
'First Record'
User::first();
Example 2: how to get just the first row from a table in laravel
$user = User::whereEmail($email)->first();
Example 3: laravel eloquent get first
// return first row by id
$user = App\User::where('id',$id)->first();
// or return directly a field
$userId = App\User::where(...)->pluck('id');