Add column in table
ALTER TABLE table_name
ADD column_name column_definition;
Add column in table
ALTER TABLE table_name
ADD column_name column_definition;
add column in exesting table
php artisan make:migration add_paid_to_users_table --table=users
//You then need to use the Schema::table() method (as you're accessing an existing table, not creating a new one). And you can add a column like this:
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');
});
}
//Then you can run your migrations:
php artisan migrate
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us