Determine attempts that are left.

@param Request $request

@return int | bool
966659
private function showAttempts(Request $request)
    {
        if ($this->config['show_attempts_left'] && $this->config['throttle']) {
            return TransFormer::transform($this->retriesLeft($request), $this->config['attempts_message']);
        }

        return false;
    }
44686
public function verify(Request $request)
    {
        if (!config('laravel2step.laravel2stepEnabled')) {
            abort(404);
        }

        if ($request->ajax()) {
            $validator = Validator::make($request->all(), [
                'v_input_1' => 'required|min:1|max:1',
                'v_input_2' => 'required|min:1|max:1',
                'v_input_3' => 'required|min:1|max:1',
                'v_input_4' => 'required|min:1|max:1',
            ]);

            if ($validator->fails()) {
                $returnData = $this->invalidCodeReturnData($validator->errors());

                return response()->json($returnData, 418);
            }

            $code = $request->v_input_1.$request->v_input_2.$request->v_input_3.$request->v_input_4;
            $validCode = $this->_twoStepAuth->authCode;

            if ($validCode != $code) {
                $returnData = $this->invalidCodeReturnData();

                return response()->json($returnData, 418);
            }

            $this->resetActivationCountdown($this->_twoStepAuth);

            $returnData = [
                'nextUri' => session('nextUri', '/'),
                'message' => trans('laravel2step::laravel-verification.titlePassed'),
            ];

            return response()->json($returnData, 200);
        } else {
            abort(404);
        }
    }
1103696
protected function checkForAlternateVerbs($request)
	{
		$methods = array_diff(Router::$verbs, array($request->getMethod()));

		// Here we will spin through all verbs except for the current request verb and
		// check to see if any routes respond to them. If they do, we will return a
		// proper error response with the correct headers on the response string.
		$others = array();

		foreach ($methods as $method)
		{
			if ( ! is_null($this->check($this->get($method), $request, false)))
			{
				$others[] = $method;
			}
		}

		return $others;
	}
1259884
public function getAdvancedSearchFieldsResults(Request $request)
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('User', 'read')) {
            return $this->noPermission();
        }
        // join parameters for the query
        // we are left joining the the media table
        $joins = array(
          [
            'table' => 'media',
            'type' => 'left',
            'whereTable1' => "profileImageID",
            'whereTable2' => "mediaID",
          ]
        );
        return Search::advanced('users', $request, User::$rowsPerPage, $request->page, $joins);
    }
303748
protected static function checkHttps(Request $request): bool
    {
        return $request->server->has('HTTPS') && 'on' === $request->server->get('HTTPS');
    }
413667
protected function getIsMerge($request)
    {
        $merge = $request->getVar('merge');

        // Default to true if not given
        if (!isset($merge)) {
            return true;
        }

        // merge=0 or merge=false will disable merge
        return !in_array($merge, array('0', 'false'));
    }
1158134
public static function requestHasFiles(Request $request) : bool
    {
        return ($request && $request->allFiles() && count($request->allFiles()) > 0);
    }
45797
public function postEdit(Request $request)
    {

        $form = FormBuilder::create(get_class($this->form), [
            'model' => $this->model
        ]);


        if ($form->hasError()) {
            return $form->validateAndRedirectBack();
        }

        $result = $this->beforeSave();

        if ($result != null) {
            return $result;
        }

        $result = $this->save($this->dataToSave($request), $request);


        if ($this->isTranslatableModel() && !$this->model->hasTranslation($this->model->getTable(), $this->model->getKey())) {
            $this->saveTranslation(app()->getLocale());
        }

        if ($result != null) {
            return $result;
        }

        return redirect()->to(action($this->getControllerNameForAction().'@getIndex'));

    }
1260026
public function login( Request $request )
	{
		$this->validateLogin( $request );

		// If the class is using the ThrottlesLogins trait, we can automatically throttle
		// the login attempts for this application. We'll key this by the username and
		// the IP address of the client making these requests into this application.
		$throttles = $this->isUsingThrottlesLoginsTrait();

		if ( $throttles && $lockedOut = $this->hasTooManyLoginAttempts( $request ) )
		{
			$this->fireLockoutEvent( $request );

			// return $this->sendLockoutResponse( $request );
		}

		$credentials = $this->getCredentials( $request );
		if ( Acct::guard( $this->getGuard() )->attempt( $credentials, $request->has( 'remember' ) ) )
			return $this->handleUserWasAuthenticated( $request, $throttles );

		// If the login attempt was unsuccessful we will increment the number of attempts
		// to login and redirect the user back to the login form. Of course, when this
		// user surpasses their maximum number of attempts they will get locked out.
		if ( $throttles && !$lockedOut )
			$this->incrementLoginAttempts( $request );

		return $this->sendFailedLoginResponse( $request );
	}
503293
public function isLocked(Request $request)
    {
        $cacheKey = $this->getCacheKey($request);

        if (!isset($this->locks[$cacheKey])) {
            return false;
        }

        return $this->locks[$cacheKey]->isAcquired();
    }
106240
protected function isRememberMeRequested(Request $request)
    {
        if (true === ($this->options[static::OPTION_ALWAYS_REMEMBER_ME] ?? false)) {
            return true;
        }

        $parameter = $request->get($this->options[static::OPTION_REMEMBER_ME_PARAMETER]);

        return 'true' === $parameter || 'on' === $parameter || '1' === $parameter || 'yes' === $parameter || true === $parameter;
    }
792152
protected function attemptLogin(Request $request)
    {
        $token = $this->guard()->attempt($this->credentials($request));

        if ($token) {
            $this->guard()->setToken($token);

            return true;
        }

        return false;
    }
71422
public function detect(Request $request)
	{
		if ($request->isMethod('post')) {
			return $request->request->get($this->parameterName);
		}

		return $request->query->get($this->parameterName);
	}
83420
public static function canBeUsedForRequest(Request $request)
    {
        return $request->has(self::CHUNK_NUMBER_INDEX) && $request->has(self::TOTAL_CHUNKS_INDEX) &&
            $request->has(self::CHUNK_UUID_INDEX);
    }
307094
protected function getTotalChunksFromRequest(Request $request)
    {
        if (!$request->get(static::KEY_CHUNK_SIZE)) {
            return 0;
        }

        return intval(
            ceil($request->get(static::KEY_TOTAL_SIZE) / $request->get(static::KEY_CHUNK_SIZE))
        );
    }
438621
protected function getOffset(Request $request)
    {
        return max(
            $request->query->get('start', 0),
            $this->getDefaultOffset($request)
        );
    }
531119
protected function isAllowed($request)
    {
        try {
            $decrypted = Crypt::decrypt($request->get('key'));
        } catch (DecryptException $e) {
            $decrypted = '';
        }

        return $decrypted == 'opcache' || in_array($this->getRequestIp($request), [$this->getServerIp(), '127.0.0.1', '::1']);
    }