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

laravel, php

Solution

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:

Schema::hasTable('mytable');

Problem

I want to be able to create a table using ``` Schema::create('mytable',function($table) { $table->increments('id'); $table->string('title'); }); ``` But before that I would like to check if the table already exists, perhaps something like ``` Schema::exists('mytable'); ``` However, the above function does not exist. What else can I use?

Original source

Related problems