Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    how to create new migration table in bagisto

    General Discussion
    3
    3
    1063
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      vinay2430 last edited by

      As migrations was written in each folders seperately,can anyone suggest me an example to create a migration table in bagisto?

      1 Reply Last reply Reply Quote 0
      • R
        rahul last edited by

        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

        1 Reply Last reply Reply Quote 0
        • ghermans
          ghermans last edited by ghermans

          1. Create your migration file as you always do in laravel
          php artisan make:migration create_my_table
          
          1. inside the /src folder from your package create a new folder Database.
          2. Go to the Database folder and create a new folder Migrations.
          3. Copy your generated migration file to packages/My/Package/src/Database
          4. 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');
              }
          

          Kind regards,
          Glenn Hermans

          Manager Bagisto Europe
          info@bagisto.eu

          1 Reply Last reply Reply Quote 1
          • First post
            Last post