Home > OS >  Tenancy for Laravel - tinker throws up migration files when creating a new tenant
Tenancy for Laravel - tinker throws up migration files when creating a new tenant

Time:03-11

I've taken over a project from a prev dev, and I'm trying to understand the tenancy for laravel package, we've past the point of no return on the project to use a new package and to be fair the package and domain is working well for the created subdomain put in by the previous dev, but when I use tinker to create a new tenant and domain, as described in the quick start doc, tinker creates the db, creates the domain and tenant but it seems to fetch a migration file from one of the subdomains too? Anyone every came across this before?

enter image description here

CodePudding user response:

Some of your migration files have the same class name, which is not allowed.

Try using anonymous classes instead and you won't run into this problem. This is possible since laravel 8.37

Instead of

class CreateAgreementSubTypesTable extends Migration { ... }

write

return new class extends Migration { ... }; // semi colon is important.
  • Related