37 lines
801 B
PHP
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)
|
|
],
|
|
];
|
|
}
|
|
}
|