Answers for "how to avoid something already exist in laravel controller"

PHP
1

if notexists in laravel query

if (User::where('email', '=', Input::get('email'))->exists()) {
   // user found
}
Posted by: Guest on July-23-2020
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 "how to avoid something already exist in laravel controller"

Browse Popular Code Answers by Language