Q:

How can set not null in migration table laravel 5.6

I set user table as below 
public function up()
{
    Schema::create('users', function (Blueprint $table) {
        $table->increments('id');
        $table->string('first_name');
        $table->string('last_name');
        $table->string('email')->unique();
        $table->string('password')->nullable();
        $table->tinyInteger('status')->unsigned()-> nullable(false) -> change()->default(1);
        $table->string('confirmation_code')->nullable();
        $table->tinyInteger('confirmed')->unsigned()->nullable(false) -> change()->default(1);
        $table->rememberToken();
        $table->unsignedInteger('deleted_at');
        $table->timestamps();
    });
}

but show error as below
     Illuminate\Database\QueryException  : SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '' (SQL: alter table `` add `status` tinyint unsigned not null default '1' after `password`, add `confirmation_code` varchar(255) null after `status`, add `confirmed` tinyint(1) not null default '1' after `confirmation_code`, add `deleted_at` timestamp null)

   at C:\xampp\htdocs\cron\vendor\laravel\framework\src\Illuminate\Database\Connection.php:664
660|         // If an exception occurs when attempting to run a query, we'll format the error
661|         // message to include the bindings with SQL, which will make this exception a
662|         // lot more helpful to the developer instead of just the database's errors.
663|         catch (Exception $e) {
 > 664|             throw new QueryException(
665|                 $query, $this->prepareBindings($bindings), $e
666|             );
667|         }
668|

  Exception trace:

  1   PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name ''")
  C:\xampp\htdocs\cron\vendor\laravel\framework\src\Illuminate\Database\Connection.php:452

  2   PDO::prepare("alter table `` add `status` tinyint unsigned not null default '1' after `password`, add `confirmation_code` varchar(255) null after `status`, add `confirmed` tinyint(1) not null default '1' after `confirmation_code`, add `deleted_at` timestamp null")
  C:\xampp\htdocs\cron\vendor\laravel\framework\src\Illuminate\Database\Connection.php:452

Please use the argument -v to see more details.
please help me to correct this migration.
I think I wrong in not null

A:

You shouldn't be using the ->change() method in Schema::create(), as it will try to change a column that hasn't been created yet. To create a column that allows null values, simply do:
Schema::create("table", function (Blueprint $table) {
  $table->string("column"); // Omit ->nullable() to force `NOT NULL`
  $table->string("nullable_column")->nullable();
});

When this migration is run, and the table is created, table.column will be initialized with NOT NULL, and table.nullable_column will be initialized as NULL.
Now, if you need to change these in a later migration, that is when you use ->nullable(false)->change();, like so:
Schema::table("table", function (Blueprint $table) {
  $table->string("column")->nullable()->change();
  $table->string("nullable_column")->nullable(false)->change();
});

Following this migration, table.column will allow NULL, while table.nullable_column will not.

