Questions tagged [laravel-request]

Laravel Requests - handling request and Request validation

218 questions
0
votes
1 answer

How to attach id of table to request in laravel while validating?

The Laravel form request validator runs a query when using exists. 'item_name'=>'required|exists:items,name' After validating for saving data I need to again run the same query and find items.id Can I prevent this extra query? I'm using validation…
Yogesh.galav
  • 225
  • 1
  • 5
  • 17
0
votes
3 answers

How pass '?filter[DBfieldname]=value&[DBfieldname2]=value2' in url in Laravel 8

I need for filtering data based on getting requests, Current Route Route::get('datasearch', [Mycontroller::class, 'MyFunction'])->name('this.is.route.name'); Current Forntend form
aGreenCoder
  • 158
  • 3
  • 14
0
votes
1 answer

How to show message to the user after email verification in Laravel?

I want to display a message to the user after email verification. Getting an email to email verification after new user sign up to the website. There is a VerficationController. how I can modify to get the notification?
0
votes
0 answers

Request Validation Not Working for PUT method In Laravel 8

My Route Route::put('dataedit/{id}', [empDataController::class, 'empDataEdit'])->middleware('guest')->name('emp.data.edit'); My Controller public function empDataEdit(empDataValidation $request, $id){ $id = Crypt::decrypt($id); …
aGreenCoder
  • 158
  • 3
  • 14
0
votes
2 answers

How to access model instance in a Request class in Laravel 8?

In my Laravel project I want to authorize user via a Request like this:
netdjw
  • 5,419
  • 21
  • 88
  • 162
0
votes
2 answers

Laravel Request: Process User Input

quick question, about User Input Request to Laravel: public function store(Request $request) { $name = $request->nameValue; //Doc: $name = $request->('nameValue'); } Do I have to put all Requests as mentioned in Doc or is the "quick" way…
Carlson
  • 183
  • 2
  • 11
0
votes
2 answers

Validate json object key in laravel request file

I have below type of json in my laravel request, I want to validate json object key in my laravel request file. I want to validate title value is required of data json. I found solution but it's for controller, I want to validate it in my request…
User PHP
  • 13
  • 3
0
votes
2 answers

How to refactor parameters in if-else condition coming from a request laravel?

I have this function in my controller that checks parameter requests and saves it into my table for tracking. However my if condition is quite too long because whenever a new request will be added I have to write individual if condition to each…
laurence keith albano
  • 1,409
  • 4
  • 27
  • 59
0
votes
1 answer

Laravel edit shallow nested resource

I'm using the following resource using shallow nesting Route::resource('organizations.emaildomains', 'OrganizationEmailDomainController', ['except' => ['show']])->shallow(); Got the following table with two records which is the result of an…
0
votes
2 answers

How to pass parameter using laravel's Request?

Currently we're doing unit testing in Laravel, and I just noticed my colleague this line below (its working fine though). I look for a documentation in Laravel about this but I can't find it. It seems all we're just focusing on getting the request…
schutte
  • 1,949
  • 7
  • 25
  • 45
0
votes
1 answer

Can't get ID from URL Laravel

I have a datatable view that shows some post from user, I want to create a datatable with a button that can show all user post. But, when moving from all post lists to user post lists I cant get user_id from the URL. I want to get the user_id using…
Vysco Zyza
  • 109
  • 1
  • 12
0
votes
1 answer

How to insert sessionStorage data using ajax request in Laravel?

I'm very new to this ajax request using laravel and currently I'm stuck. I'm having trouble inserting the sessionStorage from database. For example I have here in my sessionStorage: Key Value ================= gclid 12345 token …
laurence keith albano
  • 1,409
  • 4
  • 27
  • 59
0
votes
1 answer

How to validate array values in Laravel request class?

In my application I have a request file as below: storeFactoryUser.php public function rules() { return [ 'factory_users' => 'array', 'factory_users.*.first_name' => 'required', …
0
votes
1 answer

Laravel Request validation: validate another field based on the "name"

I have a multiple fields binded to "x-editable" plugin that sends the changed data and like all of the data, I want to validate them. But the problem here is that it always sends just 2 fields: name=is_on_probation&value=1. Here, the name key is the…
Max Krizh
  • 585
  • 3
  • 7
  • 34
0
votes
3 answers

Merge Form Request Validation for store and update

I am using Request validation to validate the user's input. This is UpdateUser:
SPQRInc
  • 162
  • 4
  • 23
  • 64