App\Http\Controllers\UsersManagementController::edit PHP Method

edit() public method

Show the form for editing the specified resource.
public edit ( integer $id ) : Illuminate\Http\Response
$id integer
return Illuminate\Http\Response
    public function edit($id)
    {
        // GET THE USER
        $user = User::find($id);
        $userRole = $user->hasRole('user');
        $editorRole = $user->hasRole('editor');
        $adminRole = $user->hasRole('administrator');
        $access;
        if ($userRole) {
            $access = '1';
        } elseif ($editorRole) {
            $access = '2';
        } elseif ($adminRole) {
            $access = '3';
        }
        return view('admin.edit-user', ['user' => $user, 'access' => $access])->with('status', 'Successfully updated user!');
    }