Skip to content
Advertisement

Is there any way to detect if a database table exists with Laravel

I want to be able to create a table using

JavaScript

But before that I would like to check if the table already exists, perhaps something like

JavaScript

However, the above function does not exist. What else can I use?

Advertisement

Answer

If you are using Laravel 4 or 5 then there is the hasTable() method, you can find it in the L4 source code or the L5 docs:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement