Answers for "check if table contains value laravel"

PHP
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
0

laravel check if table has column

if (Schema::hasTable('users')) {
    // The "users" table exists...
}

if (Schema::hasColumn('users', 'email')) {
    // The "users" table exists and has an "email" column...
}
Posted by: Guest on January-18-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
0

check if column has value in laravel eloquent

->where(function ($query) {
  $query->whereNull('exam_ends_at')
    ->orWhere('exam_ends_at', '>', Carbon::now());
})
Posted by: Guest on November-12-2020

Code answers related to "check if table contains value laravel"

Browse Popular Code Answers by Language