Answers for "check if a column existe in table laravel"

PHP
1

laravel migration check if table has column

// You may check for the existence of a table or column
// using the hasTable and hasColumn methods:

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-14-2021
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 a column existe in table laravel"

Browse Popular Code Answers by Language