Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel checking if a record exists

$user = User::where('email', '=', Input::get('email'))->first();
if ($user === null) {
   // user doesn't exist
}

            or
if (User::where('email', '=', Input::get('email'))->exists()) {
   // user found
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #checking #record #exists
ADD COMMENT
Topic
Name
6+5 =