xxxxxxxxxx
php artisan make:migration add_paid_to_users_table --table=users
public function up()
{
Schema::table('users', function($table) {
$table->integer('paid')->after('status');
});
}
public function down()
{
Schema::table('users', function($table) {
$table->dropColumn('paid');
});
}
php artisan migrate
xxxxxxxxxx
php artisan make:migration add_paid_to_users_table --table=users
public function up()
{
Schema::table('users', function($table) {
$table->integer('paid');
});
}
public function down()
{
Schema::table('users', function($table) {
$table->dropColumn('paid');
});
}
php artisan migrate
xxxxxxxxxx
public function down()
{
Schema::table('users', function($table) {
$table->dropColumn('paid');
});
}
xxxxxxxxxx
Schema::table('table_name', function (Blueprint $table) {
$table->string('column_name', 255)->nullable()->after('previous_column_name');
});
xxxxxxxxxx
Schema::table('users', function (Blueprint $table) {
$table->dateTime('verify_date')->nullable()->after("password_updated_at");
});
xxxxxxxxxx
php artisan make:migration add_yourcolumnname --table="table_name"
Enjoy and HAPPY CODING
xxxxxxxxxx
public function up()
{
Schema::table('users', function($table) {
$table->integer('paid');
});
}
public function down()
{
Schema::table('users', function($table) {
$table->dropColumn('paid');
});
}
xxxxxxxxxx
// The table method on the Schema facade MAY BE USED TO UPDATE EXISTING TABLES.
// The table method accepts two arguments: the name of the table and a Closure
// that receives a Blueprint instance you may use to add columns to the table:
Schema::table('users', function (Blueprint $table) {
$table->string('email');
});
xxxxxxxxxx
public function up()
{
Schema::table('users', function($table) {
$table->integer('paid');
});
}