Answers for "laravel migration with default data"

PHP
5

laravel migration set default value

$table->string('name')->default('Hello World!');
Posted by: Guest on May-12-2020
2

laravel migration default value

$table->increments('id');
            $table->string('name');
            $table->string('url');
            $table->string('country');
            $table->tinyInteger('status')->default('1');
            $table->timestamps();
Posted by: Guest on July-20-2021
2

insert rows in migrations laravel

public function up()
{
    // Create the table
    Schema::create('users', function($table){
        $table->increments('id');
        $table->string('email', 255);
        $table->string('password', 64);
        $table->boolean('verified');
        $table->string('token', 255);
        $table->timestamps();
    });

    // Insert some stuff
    DB::table('users')->insert(
        array(
            'email' => '[email protected]',
            'verified' => true
        )
    );
}
Posted by: Guest on March-18-2020
6

how to change existing migration laravel

php artisan make:migration update_user_guide_in_product_translations_table
Posted by: Guest on November-24-2020

Code answers related to "laravel migration with default data"

Browse Popular Code Answers by Language