public function masqueradeAsUser($user) {
        // if this user is authenticated, then we can masquerade as the
        // user that has been passed as the parameter
        if(Auth::check()) {
            // write the authenticated user into the session and then
            // authenticate as the passed user instance
            session(['masquerading_user' => Auth::user()]);
            Auth::logout();
            Auth::login($user);

            // success!
            return true;
        }

        return false;
    }