permissionService = $permissionService; parent::__construct(); } /** * Execute the console command. * * @return mixed */ public function handle() { $connection = \DB::getDefaultConnection(); if ($this->option('database') !== null) { \DB::setDefaultConnection($this->option('database')); } $this->permissionService->buildJointPermissions(); \DB::setDefaultConnection($connection); $this->comment('Permissions regenerated'); } }