Assets loaded only from last booted package

Posted 4 years ago by Kandown

Hi, I'm trying to build some packages and I stucked at this issue. I got two packages, two service providers for each. In service provider I put some stuff to be loaded after ServiceProvider is registered

public function boot() {

        include __DIR__ . '/Http/routes.php';

        $this->loadViewsFrom(__DIR__ . '/resources/views', 'users');
        $this->loadTranslationsFrom(__DIR__ . '/resources/lang', 'users');

        $this->publishes([
            __DIR__ . '/resources/views' => base_path('resources/views/modules/users'),
            __DIR__ . '/resources/lang' => base_path('resources/lang')
        ]);
    }

This works fine untill I register the second package, which has also some views and translations etc. My config/app service providers looks like this.

// Other service providers...

'Modules\Users\UsersServiceProvider',
'Modules\Comments\CommentsServiceProvider',

Assets are loaded just from the Comments module. If I change the order in the config/app and Users are the last loaded ServiceProvider, then assets are loaded from Users.

Do you have any tips how to solve this, please?

Please sign in or create an account to participate in this conversation.