FEATURE: prevent running some service providers in artisan
This commit is contained in:
@@ -3,17 +3,22 @@
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Models\Module;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class ModuleManager extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
// ignore running from artisan
|
||||
if (App::runningInConsole()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// this service provider needs published config - config is merged right after this service provider
|
||||
$modules = Module::get();
|
||||
|
||||
@@ -25,7 +30,6 @@ class ModuleManager extends ServiceProvider
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
@@ -34,7 +38,6 @@ class ModuleManager extends ServiceProvider
|
||||
|
||||
/**
|
||||
* Read config file and merge it with module config in database.
|
||||
*
|
||||
* This method REQUIRES published config of given module (otherwise config(modulename) is not available)!
|
||||
*
|
||||
* @param Module $module
|
||||
|
||||
Reference in New Issue
Block a user