Laravel Requests - handling request and Request validation
Questions tagged [laravel-request]
218 questions
0
votes
1 answer
Laravel make validation request not working
When i submit the form is nothing happens.
here is my step.
php artisan make:request PostRequest

John-H
- 13
- 1
- 4
0
votes
1 answer
Laravel Route:dispatch create new session with EncryptCookie
My code is :
…
$new_request = Request::create($page, 'GET', $request->all(), $request->cookie());
$router = Route::dispatch($new_request);
…
with…

neoteknic
- 1,930
- 16
- 32
0
votes
0 answers
Laravel Lumen: retrieving the request and the header values in the service provider class is not working
I am working on a Laravel Lumen project. I am not trying to retrieve the header values from the request inside the AuthServiceProvider class as follow.
class AuthServiceProvider extends ServiceProvider
{
/**
* Register any application…

Wai Yan Hein
- 13,651
- 35
- 180
- 372
0
votes
2 answers
How to use the ignore rule in Form Request Validation
this is PostsRequest.php in http/request:

Mehdi Jalali
- 183
- 1
- 2
- 9
0
votes
2 answers
how to use the same request to for alternative functions in Laravel
I want to validate the request to my createUser function so I create custom request and add my rules
then I want to validate the same request to my updateUser function but I want to remove the rule of "required" in a new function without create new…

Hosam Eldeen Reda
- 28
- 6
0
votes
0 answers
why $request Doesn't add or remove in laravel
...
When I make add or remove on Request it doesn't make any thing, although it works in such other places .
I'm using
$request->request->add(['item'=>value]);
and using
$request->request->remove(['item']);

Abdullah Al_Nahhal
- 130
- 1
- 7
0
votes
1 answer
How to check in Laravel if a POST request comes with form data or a JSON body? For a webhook API
I've created a webhook endpoint and now receiving requests with my Laravel application.
If request comes with the form data, I use $request->post();, if it has a json body I use $request->getContent().
I understand that there may not be both.…

Yevgeniy Afanasyev
- 37,872
- 26
- 173
- 191
0
votes
0 answers
How to authenticate in Laravel and redirect to the respective domain
I developed a multi-tenant database schema. Each subdomain connects to its respective database. Each schema has, for example, its own user table, therefore, when the user accesses the url of his own subdomain, Laravel authentication uses respective…

Magno Alberto
- 628
- 14
- 27
0
votes
1 answer
Laravel form request JSON response: Chinese Language not converted to UTF
I am not sure how I achieve this. My web app is in English and Chinese. I.t's working fine in English, but when it comes to Chinese, the mess starts.
Right now, I am using Laravel default auth, and it's working fine. The issue is when I select the…

BlackXero
- 880
- 4
- 17
0
votes
1 answer
FormRequest managing extra actions
I have a multi-step form and each step with its own FormRequest for validating fields.
All works fine but I need to make some extra actions in case one field is not validated.
So, if the FormRequest results in an error, the controller is bypassed…

Apalabrados
- 1,098
- 8
- 21
- 38
0
votes
0 answers
Laravel - How do I create a new request overwriting json()->all()
I'm developing an exporter, when I'm exporting data to an table I pass all the data trought post, inside a records parameter and the server discover if it needs to update or create a new row.
{
"records" => "[{\"foo\":\"bar\"}]"
}
I get this…

SpaceDogCS
- 2,808
- 3
- 20
- 49
0
votes
1 answer
laravel validation on array and missing parameters
I have an array which I would like to be validated. The post json payload looks like this
{
"guid" : "d19b122dc48a4663e33eaa7c83993f7a40ae9329",
"organization" : {
"phone" : "0466144569",
"email" : "test@test.com",
…

rock-star
- 88
- 7
0
votes
1 answer
Laravel Policy on Request receiving a array
I am facing a problem on a Request in which i am using a policy on it's authorize() method. It receives an array of IDs from the input request , which i then use for getting those from the DB and i have to confirm if a field called seller_id from…

Luiz Wynne
- 460
- 3
- 10
- 28
0
votes
0 answers
Laravel custom request causing 403 erros
I'm using Laravel Passport in my API project. When I create a custom Request with php artisan make:request and use it in a resource controller protected with the middleware auth:api, my custom request throws an AuthorizationException and all I can…

no0by5
- 632
- 3
- 8
- 30
0
votes
1 answer
Validate an array from html form
I have a html form. Here is a fragment:

Aleksej_Shherbak
- 2,757
- 5
- 34
- 71