#### Category : laravel-formrequest

I have 3 different forms that can post to the same controller. All 3 of these forms post the same type of data but in 3 different formats. The idea is to have 1 function that just processes the request and does validation and formatting, and stores it in the db. Code wise it will ..

I have a strange issue. When submitting a POST request I get a 302 redirect back to the create form, with message of any kind. It seems most unexpected redirects are csrf related issues. I am certain that is not the case here. I can confirm it only happens when I use a customer FormRequest ..

hel me for auth->check() why cant access pageenter image description here enter image description here Sourc..

I am using Laravel 8 and validate my requests with the form request validation. However, I have a strange problem. Before I am going to describe my problem I will paste my routes and my validation class here: routes: Route::post(‘users’, [‘as’ => ‘user.search’, ‘uses’ => ‘[email protected]’]); Route::post(‘user/name’, [‘as’ => ‘user.name.exists’, ‘uses’ => ‘[email protected]’]); Route::post(‘user/email’, [‘as’ ..

i added validationFactory function in form request , how do i call this function in my own FormRequest file (namespace AppHttpRequests) ? so i no need to include the function call in every file request how do i create custom validator function to call validationFactory function (which is my custom rule created) the default validator ..

I have a Laravel 8 application. In a form I have two fields that are both optional. I set the validation rules like so: class ValidateAddEmptyTopic extends FormRequest { public function rules() { return [ ‘title’ => ‘string|max:255’, ‘init_url’ => ‘url’ ]; } } However it still requires the fields to be included, even without ..

I am working in Laravel v6.18 project for client. Now randomly when I try to submit form with quite an amount of data, I am getting the error as below: [2020-09-17 10:05:23] local.ERROR: IlluminateValidationValidationException: The given data was invalid. in C:network-sitesvendorlaravelframeworksrcIlluminateFoundationHttpFormRequest.php:130 Stack trace: …. I know this is a generic error message created to hide ..

I have a project with a fairly standard Dev-on-Homestead to Staging to Production workflow. All are using Laravel 7.2.2/Ubuntu 18.04/PHP 7.4.3 This cropped up today with some form requests. SymfonyComponentErrorHandlerErrorFatalError Type of AppHttpRequestsCreateHighlight::$errorBag must be string (as in class IlluminateFoundationHttpFormRequest) This is a named$errorBag that we’ve been using since 5.4 or so? I changed ..
I have update method like this public function update(Contact $contact) {$this->authorize(‘ownItems’, $contact); …… } and ContactPolicy : public function ownItem(User$user,Contact \$contact) { return true; } It work correctly but when I replace Contcact to ContactRequest in my update method show me this : 403 This action is unauthorized. update method : public function ..