Loading…

How to check table is exists or not in our database using Laravel?

We can use hasTable() to check table exists in our database or not.

Syntax

Schema::hasTable('users'); // here users is the table name.

Example

                                        

if(Schema::hasTable('users')) {
   // table is exists
} else {
   // table is not exists
}

Suggest An Answer

No suggestions avaliable!

Latest post from Laravel Interview Questions

Ask Question