Closed centralcybersecurity closed 3 years ago
You found a solution for this?
No.
Hi,
the package is aimed to only cope with the very basics of the Laravel framework, leaving the other stuff free to be implemented and organized as you prefer. For many reasons I strongly prefer to have a lightweight package, so the only specific domain folders given by the package are the storage ones. And the cache ones.
For migrations and seeders, I think that there are some ways to accomplish what you need:
path
option so you can use it directly in the shellMigrateCommand
overwriting the getMigrationsPath
method by making use of the specific domain value. Probably this is what I would do.public function up() {
if (config('domain.dbgroup') === <SOMEGROUP>) {
<PERFORM TASK>
}
}
hope this helps
Cheers
Giacomo
Ok. I see this is beyond my laravel skills. As of now, I am able to identify and control what to display based on the current domain_name. So, I am more leaning on the following approach:
This seems to be an easy way for me and I don't know if this is an efficient way to do it.
As for migrations, I am okay with all DBs having all tables from a single migrations folder. So, that's settled now.
Hi,
I think that also your approach could work without any problem...
However, thinking about your problem, I will consider in future releases of extending some base commands in order to accept a specific path for each domain... it could be useful and of general purpose.
Thanks
Giacomo
Hi, first of all, this is an amazing package, able to get it up and working.
I am a little puzzled with the migrations and seeding for specific DB/Domain. I created database/migrations/site_test folder to store site_test specific files. However, when I run the command "php artisan migrate --domain=site.test" - the system loads the migration tables from the migrations folder and not the site_test folder. Why this is happening?
Also, how do I run seeders for a specific domain? Do I have to create a subfolder sites_test under /seeders/ folder - just like /migrations/ - will that work?
Thank you for your help.
Regards