title: Laravel/Lumen Incorrect Table Name '' for migrations table SQLSTATE[42000]
body: <p>When running <code>php artisan migrate</code> I get the an error when it is trying to create the migrations table in mysql:</p>
  
  <pre><code>In Connection.php line 664:
  
    SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '' (SQL: create table `` (`id` int u  
    nsigned not null auto_increment primary key, `migration` varchar(255) not null, `batch` int not null) default cha  
    racter set utf8 collate 'utf8_unicode_ci')                                                                         
  
  
  In Connection.php line 452:
  
    SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name ''  
  </code></pre>
  
  <p>Here is the full error log:</p>
  
  <pre><code>In Connection.php line 664:
  
    [Illuminate\Database\QueryException (42000)]                                                                       
    SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '' (SQL: create table `` (`id` int u  
    nsigned not null auto_increment primary key, `migration` varchar(255) not null, `batch` int not null) default cha  
    racter set utf8 collate 'utf8_unicode_ci')                                                                         
  
  
  Exception trace:
   () at /home/vagrant/api/vendor/illuminate/database/Connection.php:664
   Illuminate\Database\Connection-&gt;runQueryCallback() at /home/vagrant/api/vendor/illuminate/database/Connection.php:624
   Illuminate\Database\Connection-&gt;run() at /home/vagrant/api/vendor/illuminate/database/Connection.php:459
   Illuminate\Database\Connection-&gt;statement() at /home/vagrant/api/vendor/illuminate/database/Schema/Blueprint.php:97
   Illuminate\Database\Schema\Blueprint-&gt;build() at /home/vagrant/api/vendor/illuminate/database/Schema/Builder.php:278
   Illuminate\Database\Schema\Builder-&gt;build() at /home/vagrant/api/vendor/illuminate/database/Schema/Builder.php:167
   Illuminate\Database\Schema\Builder-&gt;create() at /home/vagrant/api/vendor/illuminate/database/Migrations/DatabaseMigrationRepository.php:157
   Illuminate\Database\Migrations\DatabaseMigrationRepository-&gt;createRepository() at /home/vagrant/api/vendor/illuminate/database/Console/Migrations/InstallCommand.php:54
   Illuminate\Database\Console\Migrations\InstallCommand-&gt;handle() at n/a:n/a
   call_user_func_array() at /home/vagrant/api/vendor/illuminate/container/BoundMethod.php:32
   Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() at /home/vagrant/api/vendor/illuminate/container/BoundMethod.php:90
   Illuminate\Container\BoundMethod::callBoundMethod() at /home/vagrant/api/vendor/illuminate/container/BoundMethod.php:34
   Illuminate\Container\BoundMethod::call() at /home/vagrant/api/vendor/illuminate/container/Container.php:576
   Illuminate\Container\Container-&gt;call() at /home/vagrant/api/vendor/illuminate/console/Command.php:183
   Illuminate\Console\Command-&gt;execute() at /home/vagrant/api/vendor/symfony/console/Command/Command.php:255
   Symfony\Component\Console\Command\Command-&gt;run() at /home/vagrant/api/vendor/illuminate/console/Command.php:170
   Illuminate\Console\Command-&gt;run() at /home/vagrant/api/vendor/illuminate/console/Command.php:198
   Illuminate\Console\Command-&gt;call() at /home/vagrant/api/vendor/illuminate/database/Console/Migrations/MigrateCommand.php:93
   Illuminate\Database\Console\Migrations\MigrateCommand-&gt;prepareDatabase() at /home/vagrant/api/vendor/illuminate/database/Console/Migrations/MigrateCommand.php:63
   Illuminate\Database\Console\Migrations\MigrateCommand-&gt;handle() at n/a:n/a
   call_user_func_array() at /home/vagrant/api/vendor/illuminate/container/BoundMethod.php:32
   Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() at /home/vagrant/api/vendor/illuminate/container/BoundMethod.php:90
   Illuminate\Container\BoundMethod::callBoundMethod() at /home/vagrant/api/vendor/illuminate/container/BoundMethod.php:34
   Illuminate\Container\BoundMethod::call() at /home/vagrant/api/vendor/illuminate/container/Container.php:576
   Illuminate\Container\Container-&gt;call() at /home/vagrant/api/vendor/illuminate/console/Command.php:183
   Illuminate\Console\Command-&gt;execute() at /home/vagrant/api/vendor/symfony/console/Command/Command.php:255
   Symfony\Component\Console\Command\Command-&gt;run() at /home/vagrant/api/vendor/illuminate/console/Command.php:170
   Illuminate\Console\Command-&gt;run() at /home/vagrant/api/vendor/symfony/console/Application.php:921
   Symfony\Component\Console\Application-&gt;doRunCommand() at /home/vagrant/api/vendor/symfony/console/Application.php:273
   Symfony\Component\Console\Application-&gt;doRun() at /home/vagrant/api/vendor/symfony/console/Application.php:149
   Symfony\Component\Console\Application-&gt;run() at /home/vagrant/api/vendor/illuminate/console/Application.php:90
   Illuminate\Console\Application-&gt;run() at /home/vagrant/api/vendor/laravel/lumen-framework/src/Console/Kernel.php:115
   Laravel\Lumen\Console\Kernel-&gt;handle() at /home/vagrant/api/artisan:35
  
  In Connection.php line 452:
  
    [PDOException (42000)]                                                           
    SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name ''  
  
  
  Exception trace:
   () at /home/vagrant/api/vendor/illuminate/database/Connection.php:452
   PDO-&gt;prepare() at /home/vagrant/api/vendor/illuminate/database/Connection.php:452
   Illuminate\Database\Connection-&gt;Illuminate\Database\{closure}() at /home/vagrant/api/vendor/illuminate/database/Connection.php:657
   Illuminate\Database\Connection-&gt;runQueryCallback() at /home/vagrant/api/vendor/illuminate/database/Connection.php:624
   Illuminate\Database\Connection-&gt;run() at /home/vagrant/api/vendor/illuminate/database/Connection.php:459
   Illuminate\Database\Connection-&gt;statement() at /home/vagrant/api/vendor/illuminate/database/Schema/Blueprint.php:97
   Illuminate\Database\Schema\Blueprint-&gt;build() at /home/vagrant/api/vendor/illuminate/database/Schema/Builder.php:278
   Illuminate\Database\Schema\Builder-&gt;build() at /home/vagrant/api/vendor/illuminate/database/Schema/Builder.php:167
   Illuminate\Database\Schema\Builder-&gt;create() at /home/vagrant/api/vendor/illuminate/database/Migrations/DatabaseMigrationRepository.php:157
   Illuminate\Database\Migrations\DatabaseMigrationRepository-&gt;createRepository() at /home/vagrant/api/vendor/illuminate/database/Console/Migrations/InstallCommand.php:54
   Illuminate\Database\Console\Migrations\InstallCommand-&gt;handle() at n/a:n/a
   call_user_func_array() at /home/vagrant/api/vendor/illuminate/container/BoundMethod.php:32
   Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() at /home/vagrant/api/vendor/illuminate/container/BoundMethod.php:90
   Illuminate\Container\BoundMethod::callBoundMethod() at /home/vagrant/api/vendor/illuminate/container/BoundMethod.php:34
   Illuminate\Container\BoundMethod::call() at /home/vagrant/api/vendor/illuminate/container/Container.php:576
   Illuminate\Container\Container-&gt;call() at /home/vagrant/api/vendor/illuminate/console/Command.php:183
   Illuminate\Console\Command-&gt;execute() at /home/vagrant/api/vendor/symfony/console/Command/Command.php:255
   Symfony\Component\Console\Command\Command-&gt;run() at /home/vagrant/api/vendor/illuminate/console/Command.php:170
   Illuminate\Console\Command-&gt;run() at /home/vagrant/api/vendor/illuminate/console/Command.php:198
   Illuminate\Console\Command-&gt;call() at /home/vagrant/api/vendor/illuminate/database/Console/Migrations/MigrateCommand.php:93
   Illuminate\Database\Console\Migrations\MigrateCommand-&gt;prepareDatabase() at /home/vagrant/api/vendor/illuminate/database/Console/Migrations/MigrateCommand.php:63
   Illuminate\Database\Console\Migrations\MigrateCommand-&gt;handle() at n/a:n/a
   call_user_func_array() at /home/vagrant/api/vendor/illuminate/container/BoundMethod.php:32
   Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() at /home/vagrant/api/vendor/illuminate/container/BoundMethod.php:90
   Illuminate\Container\BoundMethod::callBoundMethod() at /home/vagrant/api/vendor/illuminate/container/BoundMethod.php:34
   Illuminate\Container\BoundMethod::call() at /home/vagrant/api/vendor/illuminate/container/Container.php:576
   Illuminate\Container\Container-&gt;call() at /home/vagrant/api/vendor/illuminate/console/Command.php:183
   Illuminate\Console\Command-&gt;execute() at /home/vagrant/api/vendor/symfony/console/Command/Command.php:255
   Symfony\Component\Console\Command\Command-&gt;run() at /home/vagrant/api/vendor/illuminate/console/Command.php:170
   Illuminate\Console\Command-&gt;run() at /home/vagrant/api/vendor/symfony/console/Application.php:921
   Symfony\Component\Console\Application-&gt;doRunCommand() at /home/vagrant/api/vendor/symfony/console/Application.php:273
   Symfony\Component\Console\Application-&gt;doRun() at /home/vagrant/api/vendor/symfony/console/Application.php:149
   Symfony\Component\Console\Application-&gt;run() at /home/vagrant/api/vendor/illuminate/console/Application.php:90
   Illuminate\Console\Application-&gt;run() at /home/vagrant/api/vendor/laravel/lumen-framework/src/Console/Kernel.php:115
   Laravel\Lumen\Console\Kernel-&gt;handle() at /home/vagrant/api/artisan:35
  </code></pre>
  
  <p>I have tried destroying and rebuilding the vagrant instance, plus removed and reinstalled composer packages, but the problem persists.</p>
  
  <p>As requested, migration files:</p>
  
  <pre><code>    &lt;?php
  
      use Illuminate\Support\Facades\Schema;
      use Illuminate\Database\Schema\Blueprint;
      use Illuminate\Database\Migrations\Migration;
  
      class CreateTeachersTable extends Migration
      {
          /**
           * Run the migrations.
           *
           * @return void
           */
          public function up()
          {
              Schema::create('teachers', function (Blueprint $table) {
                  $table-&gt;bigIncrements('id');
                  $table-&gt;string('name');
                  $table-&gt;string('address');
                  $table-&gt;string('phone');
                  $table-&gt;string('profession');
                  $table-&gt;timestamps();
              });
          }
  
          /**
           * Reverse the migrations.
           *
           * @return void
           */
          public function down()
          {
              Schema::dropIfExists('teachers');
          }
      }
  
      &lt;?php
  
      use Illuminate\Support\Facades\Schema;
      use Illuminate\Database\Schema\Blueprint;
      use Illuminate\Database\Migrations\Migration;
  
      class CreateStudentsTable extends Migration
      {
          /**
           * Run the migrations.
           *
           * @return void
           */
          public function up()
          {
              Schema::create('students', function (Blueprint $table) {
                  $table-&gt;bigIncrements('id');
                  $table-&gt;string('name');
                  $table-&gt;string('address');
                  $table-&gt;string('phone');
                  $table-&gt;string('career');
                  $table-&gt;timestamps();
              });
          }
  
          /**
           * Reverse the migrations.
           *
           * @return void
           */
          public function down()
          {
              Schema::dropIfExists('students');
          }
      }
  
  &lt;?php
  
  use Illuminate\Support\Facades\Schema;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateCoursesTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('courses', function (Blueprint $table) {
              $table-&gt;bigIncrements('id');
              $table-&gt;string('title');
              $table-&gt;text('description');
              $table-&gt;integer('value')-&gt;unsigned();
              $table-&gt;bigInteger('teacher_id')-&gt;unsigned();
              $table-&gt;foreign('teacher_id')-&gt;references('id')-&gt;on('teachers');
              $table-&gt;timestamps();
          });
  
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::dropIfExists('courses');
      }
  }
  
  &lt;?php
  
  use Illuminate\Support\Facades\Schema;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateCourseStudentTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('course_student', function (Blueprint $table) {
              $table-&gt;bigIncrements('id');
              $table-&gt;bigInteger('course_id')-&gt;unsigned();
              $table-&gt;foreign('course_id')-&gt;references('id')-&gt;on('courses');
              $table-&gt;bigInteger('student_id')-&gt;unsigned();
              $table-&gt;foreign('student_id')-&gt;references('id')-&gt;on('students');
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::dropIfExists('course_student');
      }
  }
  
  &lt;?php
  
  use Illuminate\Support\Facades\Schema;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateUsersTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('users', function (Blueprint $table) {
              $table-&gt;bigIncrements('id');
              $table-&gt;bigInteger('role_id');
              $table-&gt;string('email')-&gt;unique();
              $table-&gt;string('first_name');
              $table-&gt;string('last_name');
              $table-&gt;string('password');
              $table-&gt;tinyInteger('status')-&gt;default(1);
              $table-&gt;tinyInteger('master')-&gt;default(0);
              $table-&gt;softDeletes();
              $table-&gt;timestamps();
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::dropIfExists('users');
      }
  }
  
  &lt;?php
  
  use Illuminate\Support\Facades\Schema;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateSystemsTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('systems', function (Blueprint $table) {
              $table-&gt;bigIncrements('id');
              $table-&gt;string('name');
              $table-&gt;tinyInteger('status');
              $table-&gt;timestamps();
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::dropIfExists('systems');
      }
  }
  
  &lt;?php
  
  use Illuminate\Support\Facades\Schema;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateUserRolesTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('user_roles', function (Blueprint $table) {
              $table-&gt;bigIncrements('id');
              $table-&gt;string('name');
              $table-&gt;bigInteger('system_id');
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::dropIfExists('user_roles');
      }
  }
  
  &lt;?php
  
  use Illuminate\Support\Facades\Schema;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateUserRolePermissionsTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('user_role_permissions', function (Blueprint $table) {
              $table-&gt;bigInteger('user_role_id');
              $table-&gt;bigInteger('permission_id');
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::dropIfExists('user_role_permissions');
      }
  }
  
  &lt;?php
  
  use Illuminate\Support\Facades\Schema;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateUserRolePermissionsTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('user_role_permissions', function (Blueprint $table) {
              $table-&gt;bigInteger('user_role_id');
              $table-&gt;bigInteger('permission_id');
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::dropIfExists('user_role_permissions');
      }
  }
  
  &lt;?php
  
  use Illuminate\Support\Facades\Schema;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateLeadTypesTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('lead_types', function (Blueprint $table) {
              $table-&gt;bigIncrements('id');
              $table-&gt;bigInteger('branch_id');
              $table-&gt;string('name');
              $table-&gt;string('token')-&gt;nullable();
              $table-&gt;softDeletes();
              $table-&gt;timestamps();
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::dropIfExists('lead_types');
      }
  }
  
  &lt;?php
  
  use Illuminate\Support\Facades\Schema;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateLeadStatusesTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('lead_statuses', function (Blueprint $table) {
              $table-&gt;bigIncrements('id');
              $table-&gt;bigInteger('branch_id');
              $table-&gt;string('name');
              $table-&gt;softDeletes();
              $table-&gt;timestamps();
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::dropIfExists('lead_statuses');
      }
  }
  
  &lt;?php
  
  use Illuminate\Support\Facades\Schema;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateLeadsTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('leads', function (Blueprint $table) {
              $table-&gt;bigIncrements('id');
              $table-&gt;bigInteger('lead_type_id');
              $table-&gt;bigInteger('status_id');
              $table-&gt;bigInteger('owner_id');
              $table-&gt;string('description');
              $table-&gt;softDeletes();
              $table-&gt;timestamps();
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::dropIfExists('leads');
      }
  }
  </code></pre>
  
  <p>On a side note the most recent package I added to the system was for mongodb <a href="https://github.com/jenssegers/laravel-mongodb" rel="nofollow noreferrer">jenssegers/mongodb</a> but disabling this has made no difference.</p>
  
  <p>config/database.php</p>
  
  <pre><code>&lt;?php
  return [
      'default' =&gt; 'mysql',
      'connections' =&gt; [
          'mysql' =&gt; [
              'driver' =&gt; 'mysql',
              'host' =&gt; env('DB_HOST'),
              'database' =&gt; env('DB_DATABASE'),
              'username' =&gt; env('DB_USERNAME'),
              'password' =&gt; env('DB_PASSWORD'),
              'charset'   =&gt; 'utf8',
              'collation' =&gt; 'utf8_unicode_ci',
          ],
          'mongodb' =&gt; [
              'driver' =&gt; 'mongodb',
              'host' =&gt; env('MONGODB_HOST'),
              'port' =&gt; env('MONGODB_PORT'),
              'database' =&gt; env('MONGODB_DATABASE'),
              'username' =&gt; env('MONGODB_USERNAME'),
              'password' =&gt; env('MONGODB_PASSWORD'),
              'options' =&gt; [
                  'database' =&gt; 'admin'
              ]
          ],
      ]
  ];
  </code></pre>
  
  <p>Requested .env file:</p>
  
  <pre><code>APP_NAME=APP
  APP_ENV=local
  APP_KEY=ka0mdHChmnMoQzSqWle7Zez
  APP_DEBUG=true
  APP_URL=http://localhost
  APP_TIMEZONE=UTC
  
  LOG_CHANNEL=stack
  LOG_SLACK_WEBHOOK_URL=
  
  DB_CONNECTION=mysql
  DB_HOST=127.0.0.1
  DB_PORT=3306
  DB_DATABASE=homestead
  DB_USERNAME=homestead
  DB_PASSWORD=secret
  
  CACHE_DRIVER=file
  QUEUE_CONNECTION=sync
  
  JWT_SECRET=VJXaIerVvIMXAF7w0Tt6FsMU8
  </code></pre>