diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index 6d0f43e..c561e53 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -48,15 +48,20 @@ public function boot(Gate $gate) $this->registerSeeds(); $this->registerConfigurations(); - if (!$this->app->runningInConsole()) { - $this->registerAcl($gate); - } + $this->registerAcl($gate); + $this->registerCommands(); } protected function registerAcl($gate) { + $table_permissions_name = app('Laravolt\Acl\Models\Permission')->getTable(); + + if (! Schema::hasTable($table_permissions_name)) { + return false; + } + $gate->before(function ($user) { $isAdmin = call_user_func(config('acl.is_admin'), $user); if ($isAdmin) {