Skip to main content

All Questions

Tagged with
0 votes
1 answer
186 views

How can I use whereHas() method in Rule::unique() for Multi Column Unique Validation

Can I use whereHas method in Rule::unique() ? There are no column here for cows, the data of cows are comming from pivot table by ManyToMany relationship. Please help me. I want something like that: ...
Shahadat Shuvo's user avatar
1 vote
0 answers
175 views

convert laravel 9 custom Rule to laravel 10 Rule

i have a custom Rule in laravel 9 and it has passes and message function like this: <?php namespace Auth\Http\Rules; use Illuminate\Contracts\Validation\Rule; class CustomRule implements Rule { ...
hossein ir's user avatar
0 votes
0 answers
58 views

Laravel Rule exists don't work with array

This is my validation rule, but with an invalid data they allow pass. 'curso_inteligencia_id' => [ 'nullable', 'array', ...
Allyson Xtreme's user avatar
0 votes
0 answers
153 views

Nested array validation rules not working on update in laravel

I have an array like this "fio" => "John Dou" "city" => "1" "birthday" => "2022-10-21" "email" => "test@...
KordDEM's user avatar
  • 214
1 vote
0 answers
141 views

Laravel exists validation: Should not pass when user and product are already stored

I have a product_votes table which stores for each user and product a value. The value can either be 1 or -1 which is equal to an upvote or downvote. A user can only either up- or downvote a product ...
Jan's user avatar
  • 645
1 vote
1 answer
943 views

laravel validation, Rule::exists or Rule::in

I want to validate sequence of items. In my idea sequence field must be exists in database sequence column or must be one plus more than maximum of present sequence. I have this code in view: <...
MFN's user avatar
  • 105
0 votes
0 answers
752 views

Implementing a rule engine in laravel

I am trying to build a rule engine for a medical app, this is the user interface i build where on satisfying the conditions, it will send the action to the account specified like an alert or email. ...
Cold Monk's user avatar
1 vote
2 answers
175 views

How to check the being unique of the model without sending the model to the update method in laravel?

Email and username are unique to the user.in validating the user update request،for email and user name I have this error: "message": "Attempt to read property "id" on string&...
Razie Etemadian's user avatar
0 votes
1 answer
928 views

Laravel: Feature test json validations unique rule issue

I recently started implementing the unit testing in Laravel 9.x framework. So far, I was able to write some basic rules without any complications. However, in my application I am validating the forms ...
Mr.Singh's user avatar
  • 1,679
1 vote
1 answer
1k views

Laravel unique validation for combined multiple fields by custom logic

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,561
0 votes
2 answers
407 views

How to set a dynamic length in laravel-nova?

I am using Nova in laravel for designing the page,i am writing some rules function which will allows digits:20 . Text::make('TrackID','id')->rules('nullable','digits:20' )->sortable()->...
user avatar
0 votes
1 answer
480 views

Laravel validation Form - Don't accept number into double quotes

I have this POST request: { "documentType": "1", "metadata": [] } And i have this validation rules: const POST_RULES = [ 'documentType' => 'required|int', ...
Mitsukk's user avatar
  • 321
0 votes
1 answer
691 views

laravel 8: validation unique multiple tables

I have a situation where I need to validate an identification number in two different tables (companies and units). The company can register the units it owns, but the system cannot allow the ...
Mauricio's user avatar
0 votes
1 answer
317 views

Laravel custom rule if previous rules passed

In Request rules() I have public function rules() { return [ 'files' => ['nullable', 'array'], 'files.*' => ['file','max:256000', new PostFiles], 'body' => '...
Lazik's user avatar
  • 39
0 votes
1 answer
1k views

Laravel validation if both field are empty then error . But if one is null then other is required

I am trying to make a rule if one is empty or not present then other is required but if both are not present then it give error. I have used this but if both are empty then it not give any error '...
Majid Javaid's user avatar

15 30 50 per page
1
2 3 4 5
7