Laravel 7 migration add column after or before
Apr 02, 2020
Hello Friends,
In this blog we are learn how to add column in table using migration. we are provide syntex of add column after column or before column migration. first you have to create migration using following command.
Add Before column is not available in laravel.
Migration Create Command
php artisan make:migration add_status_column_to_users_table --table=users
Add Column After
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->tinyInteger('status')->after('password');
});
}
- How to Notifications With database Driver in Laravel 11?
- How to Send Email Via Notification in Laravel 11?
- How to Install and Configure Laravel 11 Debugbar?
- How to Like Dislike System in Laravel 11?
- How to Paginate a Model with Relationship in Laravel 11?
- Laravel 11 Upload Files to Amazon S3 Example
- Laravel 11 Send WhatsApp Messages Example
- Laravel 11 Rest API Authentication Using JWT Tutorial