I want to be able to create a table using
JavaScript
x
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
JavaScript
Schema::exists('mytable');
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
Schema::hasTable('mytable');