<commit_before><?php

namespace SET\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Gate;

class DutyRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return Gate::allows('edit');
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name'   => 'required|max:255',
            'users'  => 'required_without:groups',
            'groups' => 'required_without:users,has_groups',
        ];
    }

    public function messages()
    {
        return [
            'users.required_without'  => 'You must have at least one user.',
            'groups.required_without' => 'You must have at least one group.',
        ];
    }
}<commit_msg>Fixed issue where creating user duties resulted in an error requiring groups.<commit_after><?php

namespace SET\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Gate;

class DutyRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return Gate::allows('edit');
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name'   => 'required|max:255',
            'users'  => 'required_without:groups',
            'groups' => 'required_without:users',
        ];
    }

    public function messages()
    {
        return [
            'users.required_without'  => 'You must have at least one user.',
            'groups.required_without' => 'You must have at least one group.',
        ];
    }
}
{'fraction_non_alphanumeric': 0.11174934725848563, 'fraction_numerical': 0.003133159268929504, 'mean_word_length': 2.0656, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3724810', 'n_tokens_mistral': 530, 'n_tokens_neox': 524, 'n_words': 149}