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