nWidart / laravel-modules

Module Management In Laravel
https://docs.laravelmodules.com
MIT License
5.5k stars 954 forks source link

Adding service provider to module/your-module/config/config.php #1913

Closed it-werxdotca closed 1 month ago

it-werxdotca commented 1 month ago

This is obviously not right as I tried and it doesn't work when copying to the base /config/your-module.php

<?php

return [
    'name' => 'Contact',
    'contact-email' => 'department@domain.com', // Replace with your actual CC email address
    /*
    |--------------------------------------------------------------------------
    | Autoloaded Service Providers
    |--------------------------------------------------------------------------
    |
    | The service providers listed here will be automatically loaded on the
    | request to your application. Feel free to add your own services to
    | this array to grant expanded functionality to your applications.
    |
    */

    'providers' => ServiceProvider::defaultProviders()->merge([
        /*
         * Package Service Providers...
         */

        /*
         * Module Service Providers...
         */
        Modules\Contact\App\Providers\AppServiceProvider::class,

    ])->toArray(),
];

Is there a way to do this properly?

it-werxdotca commented 1 month ago

Well figured it out...

Adding;

use Illuminate\Support\Facades\Facade;
use Illuminate\Support\ServiceProvider;

Worked of course. Doh!