get first result eloquent code example
Example 1: laravel get first record
'First email'
User::whereEmail($email)->first();
'First Record'
User::first();
Example 2: 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');