default value in Laravel migration

Put the default value in single quote and it will work as intended. An example of migration:

$table->increments('id');
            $table->string('name');
            $table->string('url')->nullable();
            $table->string('country')->default('india');
            $table->tinyInteger('status')->default('1');
            $table->timestamps();


Leave a Reply