You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just to start off, i think the package is excellent and is really helping me understand how to properly modularise my code in Laravel - great stuff!
I had a few questions with composer and the configuration of sub-modules and their dependency packages.
I'm using the module Media as an example to explain my problem.
(1) Composer
I have a module which uses some of it's own dependencies - I put them in the Module/Media/composer.json. I then when building my project run it as follows - for example - spatie/laravel-medialibrary. I am importing it in the Media/composer.json - I then run
cd Media
composer install
cd ..
composer install
I am then loading this, but a Trait then needs to be applied within the User model object which is in the root module - and it is erroring out as can't find the Spatie package above - does that mean I have to add the dependency in the parent as well as the Media package? Is there anyway to force the root project to actually "import" the composer dependencies in the sub-modules to make life easier? Is there something else I'm missing here?
(2) Configuration
As part of the Media sub-module I'm creating, it uses the spatie/laravel-medialibrary package which publishes a config file called media-library.php. I have put this within the Media/Config/ folder to keep all the conifigurtion related to the Media library in one place. Should this be how I specify it or should this be in the /rootproject/config directory?
I tried putting this in the Media/config directory then publishing this using
php artisan module:publish-config Media
but this exports the config for the Media module, and not the one exported from the external Spatie library
Am i doing something wrong here?
(3) Database Migrations
For the deployment process to a production environment, shoudl I be publishing the migrations from sub-modules to the root project or just running php artisan migrate to "in theory" run all migrations?
Any help here would be much appreciated.
Thanks in advance!
Moe
The text was updated successfully, but these errors were encountered:
I'm having the same problem with loading dependencies from modules, on the module side it's working fine but it's not auto-discovering those dependencies even while manually registering those will give an error on the higher project level.
So what would be the best solution? I'll understand that laravel is having its own auto discovering process but if that's now conflicting what would be the best way to add dependencies for modules in the total project?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Just to start off, i think the package is excellent and is really helping me understand how to properly modularise my code in Laravel - great stuff!
I had a few questions with composer and the configuration of sub-modules and their dependency packages.
I'm using the module Media as an example to explain my problem.
(1) Composer
I have a module which uses some of it's own dependencies - I put them in the Module/Media/composer.json. I then when building my project run it as follows - for example - spatie/laravel-medialibrary. I am importing it in the Media/composer.json - I then run
I am then loading this, but a Trait then needs to be applied within the User model object which is in the root module - and it is erroring out as can't find the Spatie package above - does that mean I have to add the dependency in the parent as well as the Media package? Is there anyway to force the root project to actually "import" the composer dependencies in the sub-modules to make life easier? Is there something else I'm missing here?
(2) Configuration
As part of the Media sub-module I'm creating, it uses the spatie/laravel-medialibrary package which publishes a config file called media-library.php. I have put this within the Media/Config/ folder to keep all the conifigurtion related to the Media library in one place. Should this be how I specify it or should this be in the /rootproject/config directory?
I tried putting this in the Media/config directory then publishing this using
but this exports the config for the Media module, and not the one exported from the external Spatie library
Am i doing something wrong here?
(3) Database Migrations
For the deployment process to a production environment, shoudl I be publishing the migrations from sub-modules to the root project or just running php artisan migrate to "in theory" run all migrations?
Any help here would be much appreciated.
Thanks in advance!
Moe
The text was updated successfully, but these errors were encountered: