/**
  * Handle the command.
  *
  * @param $command
  */
 public function handle($command)
 {
     $role = $this->roleRepository->requireBySlug($command->slug);
     $role->update(['default' => $command->default]);
     $this->roleRepository->save($role);
     $this->permissionsService->sync($role, $command->permissions);
     $this->translationService->sync($role, $command->translated);
     $this->eventDispatcher->dispatch($role->releaseEvents());
 }
示例#2
0
 /**
  * Retrieve a single role.
  *
  * @Get("roles/{slug}", middleware={"shift.account", "shift.auth"}, as="roles.show")
  *
  * @param $slug
  * @return mixed
  */
 public function getShow($slug)
 {
     $role = Translator::translate($this->roleRepository->requireBySlug($slug));
     return $this->respond('shift::roles.edit', compact('role'));
 }