<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class GroupsRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return false;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title' => ['required', 'string'],
            'datetimerange' => ['required', 'array'],
            'is_save_preview' => ['required', 'integer'],
            'group_id' => ['integer'],
            'delete_ids' => ['array'],
            'new_ids' => ['required_if:group_id,0','array'],
            'change_data' => ['array'],
//            'sort' => ['array'],
        ];
    }
}
