30 lines
603 B
PHP
Executable File
30 lines
603 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class TogglePeriodRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'marker_id' => [
|
|
'required',
|
|
'integer',
|
|
Rule::exists('markers', 'id')->where('user_id', $this->user()->id),
|
|
],
|
|
'date' => ['required', 'date_format:Y-m-d'],
|
|
];
|
|
}
|
|
}
|