laravel-request Questions

4

Solved

I want to perform certain operations with a model in a middleware. Here is an example of what I want to achieve: public function handle($request, Closure $next) { $itemId = $request->param('it...
Lewislewisite asked 3/8, 2016 at 10:32

10

Solved

Is there a Laravel way to get the current path of a Request with its query parameters? For instance, for the URL: http://www.example.com/one/two?key=value Request::getPathInfo() would return /o...
Whip asked 22/7, 2015 at 6:30

2

Solved

I want to validate the route parameters in the Request validation class. I know this question has been asked many times before but According to this question I override all() method and I receive t...

2

Solved

I'm trying to use Laravel validation to generate custom error message, however I'm unable to find the function I should be overriding. Route: POST:/entries/ uses EntryController@store which uses E...

1

Solved

I have two resources Organizations OrganizationUsers Given that I want to create in both resources and that the creation must follow specific requirements, I'm using Request rules() and attribu...
Oidea asked 3/3, 2021 at 13:11

2

Solved

I have the following code in Request class to check if the user is authorized to perform update. HandlesAuthorization trait, by default gives default message. Is there any way to return customize...

3

Solved

I am using laravel 5.6 resources controllers and form request the problem is that i have some inputs that are required on created, but on edit are optionals like file inputs. So i have this form re...

3

Solved

I am making an API and i want return the array of errors with a format as the one that $validator->errors(); generates when i validate the request by the manual way. But i cant manipulate the re...

2

Solved

@if(Request::is('login') OR Request::is('tags') OR Request::is('categories') OR Request::is('posts') OR Request::is('tags/..') OR Request::is('categories/..') OR Request::is('posts/..') OR Request:...
Arrhythmia asked 26/11, 2016 at 17:14

6

Solved

I created a custom request to make my own validation. As i follow these article. I created ProfileRequest php artisan make:request ProfileRequest Inside my ProfileRequest <?php namespace A...
Pleione asked 11/4, 2019 at 11:11

10

Solved

I want to validate the route parameters in the "form request" but don't know how to do it. Below is the code sample, I am trying with: Route // controller Server Route::group(['prefix' => 'se...
Vigilante asked 14/5, 2015 at 13:11

1

In other MVC frameworks, accessing to the current request object is as simple as $this->request. However in the Laravel, I generally see that Request $request is generally injected to each actio...
Farmer asked 9/8, 2015 at 1:57

1

Solved

Can I attach after validation hook (documentation) to my custom made request with php artisan make:request?
Wellborn asked 18/12, 2017 at 9:36

3

I wish to make search query by datepicker and select field. How could I get the requests values from below view file to controller? Where could I modify in the code? thanks. index.blade.php <d...

6

I currently have a model that has a text field and a slug field. I validate that the slug is unique in my form request class: public function rules() { return [ 'name' => 'required|min:3', ...

0

I'm unable to accept post request in Laravel because of following exception BindingResolutionException in Container.php line 819: Unresolvable dependency resolving [Parameter #0 [ <required>...
Laudable asked 15/3, 2017 at 11:13

2

Solved

I'm starting to use Laravel and I would like to know how I should choose one over the other. As of version 5.0 Laravel documentation changed request example from Request::get('form_input') to $re...
Deluxe asked 10/2, 2017 at 12:7

2

Solved

I know that one can use $request->get('my_param') or Input::get('my_param') to get a POST or GET request parameter in Laravel (I'm toying with v5/dev version now, but it's the same for 4.2). Bu...
Discourtesy asked 8/12, 2014 at 20:24

2

Solved

I want to run json_encode($request->all()) after a form is submitted, however the returned array is "polluted" with _method and _token values. Is there any neat way to exclude the framework-sp...
Pushbike asked 29/7, 2016 at 17:57

2

Solved

I have the following code, my question is how to modify Request values? public function store(CategoryRequest $request) { try { $request['slug'] = str_slug($request['name'], '_'); if ($request...
Foreclose asked 18/7, 2015 at 10:30

1

Solved

I have come across an instance where I need to alter the data that needs to be validated i.e. when no slug has been submitted, create one from the title and then validate that it is unique. The re...
Tallahassee asked 19/2, 2015 at 7:34
1

© 2022 - 2024 — McMap. All rights reserved.