laravel migration table create code example

Example 1: php artisan make migration

php artisan make:migration create_users_table

Example 2: add column in laravel migration

php artisan make:migration add_paid_to_users_table --table=users

Example 3: create laravel migration

php artisan make:migration create_users_table

Example 4: how to make-migrations in laravel

php artisan make:migration create_users_table --create=users

php artisan make:migration add_votes_to_users_table --table=users

Example 5: migrate command

golang migrate create

migrate create -ext sql -dir db/migration -seq init_schema
eg :migrate create -ext sql events

Example 6: migrate to an existing table in laravel commad

public function up()
{
    Schema::table('users', function($table) {
        $table->integer('paid');
    });
}

Tags: