Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how add new column in larevel with migration

php artisan make:migration add_paid_to_users_table --table=users


public function up()
{
    Schema::table('users', function($table) {
        $table->integer('paid');
    });
}
and don't forget to add the rollback option:

public function down()
{
    Schema::table('users', function($table) {
        $table->dropColumn('paid');
    });
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #column #larevel #migration
ADD COMMENT
Topic
Name
9+1 =