ldc-supportweb/app/Http/Requests/EraseCellContentRequest.php

38 lines
807 B
PHP
Raw Permalink Normal View History

<?php
namespace App\Http\Requests;
use App\Enums\Planning\TableRow;
use Illuminate\Foundation\Http\FormRequest;
use Kwaadpepper\Enum\Rules\EnumIsValidRule;
class EraseCellContentRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
2022-03-29 16:57:54 +02:00
* @return boolean
*/
public function authorize()
{
return auth()->check() and $this->ajax();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'id' => 'required|exists:week_plannings,id',
'day' => 'required|numeric',
'row' => [
'required',
new EnumIsValidRule(TableRow::class)
],
];
}
}