In some circumstances, you might want to check if table and/or column exists before performing any operations in database. To check that, its fairly easy in laravel.
Check if table exists in Laravel
if(Schema::hasTable($table)) {
// your code goes here
}
Don’t forget to add use Illuminate\Support\Facades\Schema;
Check if column exists in given table in Laravel
if (Schema::hasColumn($table, $column)){
// your code goes here
}