How to check table is exists or not in Laravel 5?

By Hardik Savani | April 20, 2016 | | 1721 Viewer | Category : Laravel


Share this post:

Laravel provide database migrations using Schema facade. Schema facade have sevaral method like add column, remove column, check if table exists, check if column exists etc. In bellow example you can see how to detect if a database table exists with Schema Builder. We somtimes need to check if table exists then to do something etc. So you can check this way:

Example:

Schema::hasTable('yourTable');