Questions tagged [laravel-request]

Laravel Requests - handling request and Request validation

218 questions
0
votes
1 answer

laravel middleware setting $request attribute, does it affect performance

In one of my middleware I have used something like this $user = [ 'name' => 'noob', 'phone' => '87548154' ]; /* which actually comes from redis cache */ $request->attributes->set('user', $user); and in the controller i use it…
Noob Coder
  • 2,816
  • 8
  • 36
  • 61
0
votes
0 answers

GET request for showing Edit page with no model

I need to show a blade page for editting things from the main page. The problem is that I'm using Laravel for editing things without a Model, the things are not on my application databases. In the main page I have all that I need for the "edit page"…
JahStation
  • 893
  • 3
  • 15
  • 35
0
votes
1 answer

Laravel request return to POST route

I have replaced my entity with Blog to explain better. I have the following route: Route::get('/blog-category', 'BlogController@showBlogCategory') which shows a form with a dropdown of different blog categories and some other input fields related to…
H H
  • 2,065
  • 1
  • 24
  • 30
0
votes
3 answers

How to validate unique fields while updating in make:request in laravel

I'm developing a small application in Laravel 5.5 where I'm creating a request with updateContact and having unique email validation rule, while using the same validation inside the controller I can easily make: $contact =…
Nitish Kumar
  • 6,054
  • 21
  • 82
  • 148
0
votes
1 answer

laravel URL Request validation error is not getting?

I am using Request Validation for validation. but when validation rule becomes fail then i am not getting that message like wrong name is given . I use Make::Request Method My Form Request code namespace xx\xx\xxx\Requests; use…
0
votes
2 answers

Merge 2 rules FormFequest for validate an update and store action in laravel5.5

I have 2 FormRequest classes (ReadersFormRequest, SocialMediaFormRequest) and I want to store and update a Reader. A Reader may have 0 or many social media accounts, so it's necessary to validate the request. ReadersFormRequest class…
0
votes
1 answer

Laravel: accessing url multiple time with different parameter returns wrong data

The view of my application post data to controller with a parameter in URL. The URL is like xxxx/admin/shipments/edit/50 It means I am editing the shipment having shipment_id = 50. but when user uses the application after certain time instead…
0
votes
1 answer

NotFoundHttpException with my Request file on api route

I made a route in the api file that allow everybody to create users : Route::post('users', 'UserController@addUser'); When I called it in postman without using request validation it works. But when I created my request file and use it, Laravel…
EkinOf
  • 451
  • 1
  • 7
  • 18
0
votes
2 answers

Laravel 5.4: Passing a variable via Request to controller

Generally speaking this should be a rather simple problem. IT should be very similar to the following question on Stack Overflow But seeing as it has been two years, maybe some of the syntax has changed. All I want to do is pass a variable from the…
0
votes
1 answer

Having a challenge with Laravel 5.4 requests namespace

I'm trying to reference the Requests class in Laravel, I've tried so many fixes with the keyword "use" but each time I keep getting Reflection exception that says app\path\specified doesn't exist. I'm confused. Here is my code:`
Vanessa
  • 43
  • 3
  • 12
0
votes
2 answers

Laravel validation - unique with nullable where

I have to write validation rule that should verify if address is unique on rows where routing_id has given value. That is simple. But in some cases routing_id field may be NULL and then my validation request rule doesn't work. Here is my…
piotr
  • 1,282
  • 1
  • 8
  • 20
0
votes
2 answers

Laravel Request validation

I hope you guys can help me. I have these file inputs in a form: Select images: Select videos: And my goal is to force the user to upload an…
0
votes
2 answers

Modify Laravel request before insert

Is is possible to modify a request before it gets inserted into the database? public function store(StoreRequest $request) { $request->date_posted = strtotime($request->date_posted); //insert data here. }
LeBlaireau
  • 17,133
  • 33
  • 112
  • 192
0
votes
0 answers

Laravel - BindingResolutionExceptionUnresolvable dependency resolving [Parameter #0 [ $method ]] in class GuzzleHttp\Psr7\Request

I'm unable to accept post request in Laravel because of following exception BindingResolutionException in Container.php line 819: Unresolvable dependency resolving [Parameter #0 [ $method ]] in class GuzzleHttp\Psr7\Request Before…
0
votes
1 answer

Laravel TransformRequest not applying to own Request classes

This issue was fixed in Laravel 5.4.9. The two new middleware classes doesn't apply to my own Requests. The two new middleware…
andershagbard
  • 1,116
  • 2
  • 14
  • 38