laravel-sketchpad icon indicating copy to clipboard operation
laravel-sketchpad copied to clipboard

Add auto discovery

Open aembadawy opened this issue 7 years ago • 3 comments

aembadawy avatar Jul 26 '17 04:07 aembadawy

Hey Aya,

Thanks for this.

How does it work when you want to disable a package in production?

// AppServiceProvider::register
if ($this->app->environment() !== 'production') {
    $this->app->register(\davestewart\sketchpad\SketchpadServiceProvider::class);
}

davestewart avatar Jul 26 '17 08:07 davestewart

@davestewart the package will be auto discovered even if this condition is set in the App service provider , you can disable the package by setting it's name in the dont-discover , then the developer will handle the logic of when to register it or not , like the above condition .

https://medium.com/@taylorotwell/package-auto-discovery-in-laravel-5-5-ea9e3ab20518

amaelftah avatar Jul 26 '17 17:07 amaelftah

Please add this, it will only affect Laravel 5.5 and we can install it as dev and avoid it in production :-)

People can freely use the old method if they want

EmilMoe avatar Oct 09 '17 10:10 EmilMoe