ldc-supportweb/app/Http/Requests/Bo/EraseCellContentRequest.php
2023-08-14 09:23:39 +00:00

37 lines
801 B
PHP

<?php
namespace App\Http\Requests\Bo;
use App\Enums\Planning\TableRowEnum;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rules\Enum;
class EraseCellContentRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @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 Enum(TableRowEnum::class)
],
];
}
}