コード例 #1
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     $user = $this->users->create($data);
     $userRole = $this->roles->findByName('user');
     $this->users->attachRole($user, $userRole);
     return $user;
 }
コード例 #2
0
 /**
  * Get all roles.
  *
  * /admin/roles get
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function index()
 {
     $roles = $this->roles->listAll();
     return $this->responseJson(compact('roles'));
 }