<?php

namespace App\Rules;

use Illuminate\Contracts\Validation\Rule;

class AtLeastOneSelected implements Rule
{
    public function passes($attribute, $value)
    {
        return count($value) > 0;
    }

    public function message()
    {
        return 'At least one product must be selected.';
    }
}
 
?>