how to create new migration table in bagisto
-
As migrations was written in each folders seperately,can anyone suggest me an example to create a migration table in bagisto?
-
Hi @vinay2430
Run migration command normally as you do in laravel then migration file will be generated in laravel's default database folder (migrations) then move this file to your package's migration folder.
Thanks
-
- Create your migration file as you always do in laravel
php artisan make:migration create_my_table
- inside the /src folder from your package create a new folder Database.
- Go to the Database folder and create a new folder Migrations.
- Copy your generated migration file to packages/My/Package/src/Database
- Open your package service provider and add your migrations folder to the boot method
class MyPackageServiceProvider extends ServiceProvider { /** * Perform post-registration booting of services.. * * @return void */ public function boot() { $this->loadMigrationsFrom(__DIR__.'/../Database/Migrations'); }