gecche / laravel-multidomain

A Laravel extension for using a laravel application on a multi domain setting
MIT License
838 stars 105 forks source link

Override QueueServiceProvider in app.php in Laravel 10 #93

Closed thijs1970 closed 1 year ago

thijs1970 commented 1 year ago

In the installation it says to override service provider "Illuminate\Queue\QueueServiceProvider" with "Gecche\Multidomain\Queue\QueueServiceProvider" in "config\app.php".

Unfortunately the Illuminate\Queue\QueueServiceProvider is not listed anymore in Laravel 10 in app.php.

How can I make the service provider override?

adam-godfrey commented 1 year ago

I'm using the latest version of Laravel and just added it to "config/app.php" and it all worked

gecche commented 1 year ago

Hi all,

I'm sorry but I forgot to reply to the issue :)

However as pointed out by Adam you have just to add it to config/app.php instead of override for Laravel 10.

I will change the documentation accordingly asap

Thanks

Giacomo

thijs1970 commented 1 year ago

Hi Adam and Giacomo,

Thanks for your answers. No problem wit the late reply.

Regards, Thijs

lukeholder commented 10 months ago

The documentation is still out of date on this.

webnatrix commented 3 months ago

Tell me how we can do it in version 11? It is not clear how to implement point 2.

gecche commented 3 months ago

In Laravel 11, if you haven't changed the original config/app.php you have to put in that file all the structure below (the same you found in the package instructions):

```

'providers' => \Illuminate\Support\ServiceProvider::defaultProviders()->merge([ // Package Service Providers... ])->replace([ \Illuminate\Queue\QueueServiceProvider::class => \Gecche\Multidomain\Queue\QueueServiceProvider::class, ])->merge([ // Added Service Providers (Do not remove this line)... ])->toArray(),



If you have already changed that file (for other reasons or packages) and you have already put in it such a structure, the only  important row is the following:

`
      \Illuminate\Queue\QueueServiceProvider::class => \Gecche\Multidomain\Queue\QueueServiceProvider::class,
`

Hope this helps

Giacomo