if (Schema::hasTable('users')) { // The "users" table exists... } if (Schema::hasColumn('users', 'email')) { // The "users" table exists and has an "email" column... }
->where(function ($query) { $query->whereNull('exam_ends_at') ->orWhere('exam_ends_at', '>', Carbon::now()); })