Owl\Http\Controllers\UserRoleController::initialRegister PHP Method

initialRegister() public method

public initialRegister ( )
    public function initialRegister()
    {
        $owners = $this->userService->getOwners();
        if (!empty($owners)) {
            \App::abort(500);
        }
        $user = $this->userService->getCurrentUser();
        if ($user == null) {
            \App::abort(404);
        }
        $user->role = UserRoleService::ROLE_ID_OWNER;
        $updateUser = $this->userService->update($user->id, $user->username, $user->email, $user->role);
        $this->authService->setUser($updateUser);
        return view('user.role.initialComplete');
    }