Category : laravel-formrequest

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’ ..

Read more

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 ..

Read more

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 ..

Read more

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 ..

Read more