Hello Friends 👋,
Welcome To Infinitbility! ❤️
this article explain how to Select only first row or single row in laravel.
first() method to Select only single row using
first() you will not required to write like this
If you just need to retrieve a single row from a database table, you may use the DB facade’s first method. This method will return a single stdClass object:
$user = DB::table('users')->where('name', 'John')->first(); return $user->email;
Thanks For Reading…