Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
53 views

Within a Laravel project, I want to create a POST /movies route associated with a controller that has been created with its model: sail artisan make:model --controller --api --requests -- Movie which ...
lavalade's user avatar
  • 368
-1 votes
1 answer
155 views

I have got a problem with Laravel. I have created a custom Form Request - let's call it CustomFormRequest. It is authorized and have got rules as it should be. In one of the classes I use this request ...
Erős Tamás Mihály's user avatar
0 votes
4 answers
142 views

I have this type of date: "Date": "2024-09-06T06:58:19.326Z", How should I validate it in my FormRequest in Laravel? I've tried this: 'required|date_format:Y-m-d\TH:i:s.u\Z' and ...
foreveryoungguy's user avatar
1 vote
0 answers
66 views

I've implemented the form validation in Laravel by creating my own UserStoreRequest class, which extends the FormRequest class. I'm using Ajax. BTW, whenever the validation fails, Laravel ...
mzhkhokhar's user avatar
-1 votes
2 answers
149 views

I have a Laravel app (v10.30.1) this api routes block: <?php use App\Http\Controllers\EmployeeController; use Illuminate\Support\Facades\Route; Route::prefix('v1')->group(function () { ...
Thiago Maciel's user avatar
1 vote
2 answers
171 views

So I was trying to use Laravel custom request, following the documentation: api.php Route::post('/register-user', [AuthController::class, 'register']); AuthController.php namespace App\Http\...
Matheus Filho's user avatar
1 vote
2 answers
241 views

I have custom validation for my form request. When users input the value and the value exists also field deleted_at is not null this validation should be working. the problem is even when I input the ...
Dava Eranda's user avatar
1 vote
0 answers
67 views

I want make a validation for my products table where SKU field deleted_at is not null (yes i have softdeletes). what i have done is make Custom Rules: namespace App\Rules; use Closure; use Illuminate\...
Dava Eranda's user avatar
0 votes
1 answer
161 views

When I am requesting all parameters than it is giving me NULL My Controller store function as: public function store(Request $request) { dd($request->all()); } My view file as: @extends('main'...
Ali's user avatar
  • 345
0 votes
1 answer
655 views

I am validating a credit card, for which I created two form requests: php artisan make:request StoreAmexRequest php artisan make:request StoreVisaRequest How can I use them in the same controller? ...
Daniel DD's user avatar
0 votes
1 answer
70 views

I have several models in a Laravel/Backpack app where write access to certain properties is restricted to certain user roles. Say I have a model Client with the properties name phone active viewCount ...
Pekka's user avatar
  • 451k
0 votes
0 answers
98 views

I have two fields that FormRequest is expecting to receive as a set: image_id and image_path. However I want to only return a single message using the field image_path when the FormRequest receives a ...
Mr. Kenneth's user avatar
  • 1,047
3 votes
1 answer
2k views

I am creating a rule for my validation on my laravel app. i wrote my rules below public function rules() { return [ 'title' => 'required|string', 'taxonomies' =&...
Fidelis E Peter's user avatar
4 votes
1 answer
907 views

I have created a custom request form for login validation, It works fine if I put email and password field that's what I set for rules, email and password is required, but the problem is, I can't use ...
Sakib Hasan's user avatar
0 votes
1 answer
116 views

I have a form request with rules return [ 'brand_id' => ['required', 'integer'], 'color_id' => ['required', 'integer'], 'name' => ['required', 'max:255', 'string'], 'capital' =...
Rezky Rizaldi's user avatar
2 votes
0 answers
62 views

I have created a FormRequest for updating a BlogPost as UpdateBlogRequest. I set thumbnail as a "present" for validation. but when this input is empty I get "The thumbnail field must be ...
Amirhossein Hajighorbani's user avatar
2 votes
3 answers
594 views

There are space comes after every character of field name while displaying errors in blade template in laravel 9 as mentioned in uploaded image my code is mentioned as below CODE IN HTML IS : <...
BILAL THAKOR's user avatar
2 votes
1 answer
1k views

I need to create a custom request on the fly and pass the request to the Form Request. The closest answer that I found was this SO answer. However when I run $request->validated(), it gives me ...
Mr. Kenneth's user avatar
  • 1,047
0 votes
1 answer
219 views

How to merge eloquent validation rule with a Rule:: This is what I am attempting to run, but it chokes on the [ ] with Method Illuminate\Validation\Validator::validateRequired|email does not exist. ...
wruckie's user avatar
  • 1,821
0 votes
1 answer
244 views

Working in Laravel 9, and I am doing my validations in FormRequests. I have a email_updates table. I have 3 columns, email, product_uuid, affiliate_uuid, and I am looking to enforce row uniqueness. An ...
wruckie's user avatar
  • 1,821
-1 votes
3 answers
264 views

return [ 'contract_code' => 'required', 'name' => 'required|string', 'abbreviation' => 'required|string', 'linecount_divisor' => 'required|integer' ]; // into input fields => '...
Newbie's user avatar
  • 11
-1 votes
1 answer
114 views

I am having trouble using the Laravel Validator to validate some data. The validator is modifying properties of the input to null. The data passed to be validated is a mix of array and objects (in ...
mowses's user avatar
  • 29
0 votes
0 answers
34 views

I have no problem to get "required", "unique" or "email" rules translated. However, required_if and prohibited_if keep showing up in English. File lang/es/validation.php ...
fombo's user avatar
  • 95
0 votes
1 answer
125 views

I am new to Laravel. I try to validate an array in Laravel 9. for using a unique filter I have a problem. at first, I try to use this way $rules = [ '*.id' => 'integer|required', '*.key' =&...
pedram shabani's user avatar
1 vote
2 answers
746 views

I have a Laravel 9 API. I am posting the following json to an endpoint. { "shapes": [ { "type": "Point", "coordinates": [1, 2] }, { ...
Hoult74's user avatar
  • 35
1 vote
1 answer
207 views

I'm trying to validate three input fields. If the fields are null then the three fields are not mandatory, but If at least one of them is not empty (null) then all three should be mandatory. But It's ...
Hugo Pedro's user avatar
-1 votes
3 answers
892 views

I am working with laravel 9.1. I want to validate two request inputs in single column of a table. below is my validation rule in form request. Basically name = resource_name . permission_type i ...
Wcan's user avatar
  • 888
2 votes
3 answers
4k views

i'm new to laravel , hope someone could help me with this problem , i've created a request class to validate my inputs . But when the validation fails it doesn't return any error messages instead ...
adithyan.cs's user avatar
0 votes
0 answers
187 views

In some methods of a controller I would like to be able to use different FormRequest depending on a value in the querystring, for example: // always using the same route, only qs change // different ...
Alex's user avatar
  • 3,464
1 vote
2 answers
2k views

I know i can get the errors in a view with @if ($errors->any()) or similars. But what if I want to get the validation errors in the Controller to return it as JSON? RegisterRequest.php <?php ...
Sasquatch's user avatar
  • 117
0 votes
2 answers
2k views

I have a FormRequest with the withValidator() method (which I copied exactly as it is in the Laravel documentation), but when executing the class an error is returned. Class: <?php namespace App\...
Lucas's user avatar
  • 452
0 votes
1 answer
105 views

I've created a FormRequest to validate some fields, and I would like that one of those fields only accept the options that a I give it Searching I found something like this "rule" => '...
mw.7225's user avatar
0 votes
1 answer
80 views

I'm recieving the following error from the from request class in Laravel. BadMethodCallException: Method Illuminate\Validation\Validator::validateNumeric|max does not exist. in /var/www/html/vendor/...
Bulent's user avatar
  • 3,441
1 vote
2 answers
372 views

This is very strange. I have an endpoint that accepts a PUT request. namespace App\Http\Requests; use Dingo\Api\Http\FormRequest; class UpdateTestRequest extends FormRequest { public function ...
Simon's user avatar
  • 2,703
1 vote
1 answer
4k views

I'm going to edit a row using form request validate laravel, but when editing if I do not change the email, The email has already been taken error. Gives this is from request validate EditAdmin <?...
samira's user avatar
  • 11
0 votes
1 answer
940 views

My form has 4 fields name, email, website and image When only name, email, website fields are passed the following code saves the data perfectly to my DataBase. public function store(...
Simba's user avatar
  • 99
0 votes
0 answers
75 views

I was trying to update the dropdown value from user input to database here is my code- my drop down input field in the user from - <div class="form-group"> {{Form::label('...
Abdur Rahman Prince's user avatar
-1 votes
1 answer
754 views

I'm using Laravel 8, and in the Laravel document, I see this line of code for retrieving the validated input data then using form requests. // Retrieve the validated input data... $validated = $...
Amirhossein Aliakbarpour's user avatar
0 votes
2 answers
1k views

Say I have a custom logic for validating the uniqueness of a FormRequest field, something requiring to find another resource in the database like below: class CreateMyResourceRequest extends ...
wileecoyote's user avatar
1 vote
1 answer
1k views

I am currently using Laravel 9 for my project. Here is my validation rules public function rules() { $parent_id = $this->parent_id != 0 ? $this->parent_id : null; return [ 'name'...
JS TECH's user avatar
  • 1,583
1 vote
1 answer
2k views

Im testing out the new laravel 9 and I sadly come across this surprise. After using PHP artisan make:request UpdateUserRequest and setting this as my request class on the incoming update function, ...
Alex's user avatar
  • 446
0 votes
1 answer
625 views

I'm working with Laravel nested resources to serve a many-to-many relationship. I'm working on a Football app and I want to link Competitions with Seasons, e.g. Premier League with 2021/22 season. ...
wileecoyote's user avatar
2 votes
1 answer
1k views

I find something lost... The problem I need to construct 2 custom FormRequest from 1 normal Request Let's suppose this fake scenario First FormRequest StoreClientRequest Second FormRequest ...
Angel Ponce's user avatar
1 vote
3 answers
2k views

I've created a custom form request with php aritisan make:request, I have added in validation rules: public function rules() { return [ 'first_name' => 'required|string',...
rawac41707's user avatar
5 votes
1 answer
4k views

I am using FormRequest to validate data. I know this question was asked many times, and the community tried to solve this issue in many ways, but none of them solved my problem. Reference links are ...
msayubi76's user avatar
  • 1,718
0 votes
1 answer
259 views

I've a simple code (more o less) like this. Routes: Route::post('car', 'CarController@store')->name('insert_car.store'); Route::post('car-italian', 'CarItalianController@store')->name('...
vlauciani's user avatar
  • 1,100
0 votes
1 answer
123 views

I'm working on Form Request and I've a question about how to use it with optional input object. My API get a simple input JSON like: { "user": [ { "name": &...
vlauciani's user avatar
  • 1,100
0 votes
0 answers
1k views

I have an array of objects with different, dynamic parameters. And I'm trying to find a way to validate it based on the object type value. Is there any way to make it with the FormRequest? [ { ...
Alexander K.'s user avatar
0 votes
2 answers
1k views

I've looked around but I haven't been able to find a way to perform an existence check of a resource before validating an incoming request with Laravel 8 FormRequest classes. Basically, I want to ...
wileecoyote's user avatar
0 votes
4 answers
1k views

I'm using form request to validate data into update method. I'm trying to validate email as a unique value expect requested user email like this public function rules() { $user = $this->user();...
ihprince's user avatar
  • 157