Laravel validation exists where NOT

0 votes

Exists can have 4 parameters:

exists:table,id,where,0

The question is, What if I wanted it to be where is not. Like where is not 0.

$validator = Validator::make(
    array(
        'groups' => $groups
    ),
    array(
        'groups' => 'required|exists:groups,jid,parent,!=,0'
    )
);
Dec 3, 2020 in Laravel by kartik
• 37,520 points
5,604 views

1 answer to this question.

0 votes

You can use unique

Example

'email' => 'unique:users,email_address,NULL,id,account_id,1'
answered Dec 3, 2020 by Niroj
• 82,880 points

Related Questions In Laravel

0 votes
1 answer

How to create custom validation rules with Laravel?

Hii @kartik, Follow are the steps to create ...READ MORE

answered Mar 24, 2020 in Laravel by Niroj
• 82,880 points
1,178 views
0 votes
1 answer

Explain Extending Bindings in Laravel? And where to extend the bind in laravel?

Hii,  The extend method allows the modification of ...READ MORE

answered Mar 26, 2020 in Laravel by Niroj
• 82,880 points
1,718 views
0 votes
1 answer

How can we Create Multiple Where Clause Query Using Laravel Eloquent?

Hii, You can use Conditions using Array: $users = User::where([ ...READ MORE

answered Mar 30, 2020 in Laravel by Niroj
• 82,880 points
16,677 views
+1 vote
1 answer

How to check if a record already exists in a laravel?

Hey, As a newbie it is most common ...READ MORE

answered Mar 31, 2020 in Laravel by Niroj
• 82,880 points
32,530 views
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,880 points
22,878 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,880 points
2,932 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,880 points
2,866 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,880 points
44,215 views
0 votes
1 answer

Error:Laravel Migration table already exists but i want to add new not the older

Hello @kartik, You need to run php artisan migrate:rollback if ...READ MORE

answered Aug 11, 2020 in Laravel by Niroj
• 82,880 points
11,442 views
0 votes
1 answer

How to check request is ajax or not in Laravel?

Hello, Laravel allow use of their library method that ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,880 points
12,940 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP