Laravel obtiene el primer disco
'First email'
User::whereEmail($email)->first();
'First Record'
User::first();
MrDracoula
'First email'
User::whereEmail($email)->first();
'First Record'
User::first();
// return first row by id
$user = App\User::where('id',$id)->first();
// or return directly a field
$userId = App\User::where(...)->pluck('id');
$user = User::whereEmail($email)->first();
$user = DB::table('users')->where('name', 'John')->first();
var_dump($user->name);
$first = $msgs->first(); // this does ->take(1) under the hood