Answers for "laravel eloquent exists"

PHP
1

laravel exist

if (User::where('email', $request->email)->exists()) {
   //email exists in user table
}
Posted by: Guest on July-31-2021
5

laravel check record exists

$user = User::where('email', '=', Input::get('email'))->first();
if ($user === null) {
   // user doesn't exist
}
Posted by: Guest on April-08-2020
1

laravel update if exists or create

$flight = App\Flight::updateOrCreate(
    ['departure' => 'Oakland', 'destination' => 'San Diego'],
    ['price' => 99]
);
Posted by: Guest on June-20-2021
1

laravel exist

if($user->isEmpty()){
    // has no records
}
Posted by: Guest on July-31-2021
1

check for an existing user laravel eloquent

$users = User::where('email', '=', $request->input('email'))->first();
if ($users === null) {
  // User does not exist
} else {
  // User exits
}
Posted by: Guest on August-18-2020

Code answers related to "laravel eloquent exists"

Browse Popular Code Answers by Language