lundi 9 novembre 2020

How do i pass an eloquent collection to a validation rule?

I have this rule:

Validator::make($data, [
    'category' => [
        'required',
        Rule::notIn(['news', 'article']),
    ],
]);

The problem is that news and article are stored in another table. How do i pass the the data from that table into notIn instead?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/32x3wca
via IFTTT

Aucun commentaire:

Enregistrer un commentaire