You can check if a table exists with
if (Schema::hasTable('todos'))
{
//
}
When creating a table, don't use Schema::table but do the following:
Schema::create('todos', function($table)
{
$table->increments('id');
});
Also use the artisan command to create migrations
php artisan make:migration create_todo_table --create=todos
use the --table option if you want to create a migration to alter a table
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community