/** * 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; }
/** * Get all roles. * * /admin/roles get * * @return \Illuminate\Http\JsonResponse */ public function index() { $roles = $this->roles->listAll(); return $this->responseJson(compact('roles')); }