laravel-validation Questions

2

Solved

I'm new to Laravel where I'm using Laravel's validator for a project not built in Laravel. I need to know if there is a simple built in Laravel validator to validate the sum of a certain field in...
Microscopic asked 15/7, 2018 at 13:3

9

I have some trouble with validation in Laravel 5.2 When i try validate request in controller like this $this->validate($request, [ 'title' => 'required', 'content.*.rate' => 'required',...
Suellensuelo asked 22/12, 2015 at 16:44

6

My form has the same input field multiple times. My form field is as follows: <input type='text' name='items[]'> <input type='text' name='items[]'> <input type='text' name='items[]'...
Label asked 19/9, 2018 at 11:10

9

Solved

When I want to register a user in my laravel project, the page always says Undefined variable: errors (View: /var/www/resources/views/auth/register.blade.php)" According to the Laravel docume...
Simulacrum asked 24/12, 2015 at 14:12

2

Solved

My registration form and login form are on the same page, but in different tabs. By default the active tab is login. While registering if there is any errors, the error messages are returned and I ...
Chauncey asked 5/7, 2018 at 8:36

1

Solved

I have two tables, first one is students and second one is lesson_student table. They have m2m relationship between students and lessons tables. I want to check, if student_id exists in students ta...
Adjacent asked 18/6, 2018 at 17:28

1

Solved

I have a rule like so: Rule::exists('tokens', 'key') ->where(function ($q) { $q->where('state', 'unused'); }) But I'm trying to get access to the actual Token model scopes so I can just...
Luger asked 6/11, 2017 at 12:14

1

Solved

I am submitting a single dimensional array of values to process on laravel 5.6 quantity[4]:11 quantity[2]:14 I have to validate both the index and the value, index should exits as stocks,id and ...
Thrombin asked 5/6, 2018 at 7:14

1

Laravel required_without is not working when I'm passing multiple fields. This is my rules: $rules = [ 'startDate' => 'date|date_format:m/d/Y|required_without:customerId,purchaseId,orderId', ...
Ambivalence asked 12/1, 2018 at 13:42

2

Solved

My Eloquent model consists of 30 fields. Validation Rule: The first field is required Out of the other 29 fields, at least one field is required. Checking the documentation of Laravel 5.5, I f...
Chromatophore asked 27/12, 2017 at 17:37

2

Solved

Does the validation class in Laravel validate exact words? eg $rules = [ "field" => "hello" ] Where the value of the field must be "hello".
Chevalier asked 7/5, 2014 at 5:56

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

2

Solved

Quoting the Laravel documentation: By default, Laravel's base controller class uses a ValidatesRequests trait which provides a convenient method to validate incoming HTTP request with a variety ...
Assured asked 16/11, 2017 at 16:13

1

Solved

I am trying to validate latitude/longitude in Laravel 5.4 project with custom regex rule (based on this answer: https://mcmap.net/q/496928/-php-validate-latitude-longitude-strings-in-decimal-...
Beauregard asked 8/11, 2017 at 16:13

5

Solved

Laravel 5.5 public function register(Request $request) { request()->validate([ 'email' => 'required:email' 'password' => 'required|min:6' ]); return response()->json(["messag...
Specialism asked 22/9, 2017 at 14:10

1

Solved

The validator in laravel can have a customization of the exists database rule, for instance if you need to check an extra column. An example from the manual: use Illuminate\Validation\Rule; Valid...

2

Solved

'person.mail' =>'required_without:person.phone|sometimes|email|unique:persons,mail', 'person.phone' => 'required_without:person.mail|sometimes|regex:/[0-9]/|size:10|unique:persons,phone' i...
Inflectional asked 24/8, 2017 at 20:19

2

Solved

I already tried have a look at https://laravel.com/docs/5.4/validation but still , i don't really get what's is the difference between : required_with_all and required_without Anyone c...
Kenwee asked 20/6, 2017 at 4:47

3

Solved

I've created a set of custom validation rules in my Laravel application. I first created a validators.php file which is in the App\Http directory: /** * Require a certain number of parameters to ...
Resident asked 29/3, 2015 at 3:39

2

Solved

I have 3 types of data to validate data in group single data single and data in group combined This validation works for single data $validator = Validator::make($request->all(), [ 'tests....
Argument asked 17/3, 2017 at 14:13

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', ...

1

Solved

I am trying to validate a date field only if it is present. It was working fine before I upgraded from Laravel 5.2 to 5.4 In Laravel 5.2 this rules works fine: public function rules() { return [...
Flavouring asked 4/2, 2017 at 10:44

2

I use Laravel 5.3. I want to use form validation to test the hash for user's password. Here is my code : $validator = Validator::make($request->all(), [ 'old_password' => 'required|max:20|mi...
Semimonthly asked 17/1, 2017 at 13:4

2

I have table in which i'm trying to store email addresses. These email addresses will be save with user_id. For example in email_list table |ID | user_id | email | ..................................
Intestine asked 20/9, 2016 at 10:21

3

Solved

foo.blade.php <input type="text" name="national-id" /> FooController.php $rules = [ 'national-id' => 'required|size:10|numeric' ]; the national-id field should contain 10 digits and...
Hanford asked 16/9, 2016 at 20:13

© 2022 - 2024 — McMap. All rights reserved.