ArionsMigrations is a simple Laravel package that allows the users to create migrations using the
method before();
. Until now Laravel allows users to update a table and use only after();
This can be a bit time wasting for a user that needs to see the table to find which column comes so they can
use after();
when they know the other column.
composer require arionmigrations/arion-migrations
ArionMigrations\Providers\ArionMigrationServiceProvider::class
With after();
its like this:
Schema::create('users', function (Blueprint $table) {
$table->string('email')->before('name');
});
With before();
its like this:
Schema::create('users', function (Blueprint $table) {
$table->before('before_column_name','new_column_name','type', 'length', 'default');
});
The default length for string is 255
, but you can add your own length and the default is nullable but it can be changed.
After you have writen the migration just execute the migration
php artisan migrate