/** * Configure Javascript remote validations. * * @param Validator $validator */ protected function configureJsRemote(Validator $validator) { if (is_null($this->sessionStore)) { return; } $token = $this->sessionStore->token(); if (!is_null($this->container['encrypter'])) { $token = $this->container['encrypter']->encrypt($token); } $validator->setRemoteToken($token); $validator->enableRemote($this->jsRemoteEnabled); }
/** * Get the CSRF token value. * * @return string * @static */ public static function token() { return \Illuminate\Session\Store::token(); }