38 lines
807 B
PHP
38 lines
807 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Requests\Bo;
|
||
|
|
|
||
|
|
use Illuminate\Foundation\Http\FormRequest;
|
||
|
|
|
||
|
|
class ShowInterfaceRequest extends FormRequest
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Determine if the user is authorized to make this request.
|
||
|
|
*
|
||
|
|
* @return boolean
|
||
|
|
*/
|
||
|
|
public function authorize(): bool
|
||
|
|
{
|
||
|
|
return auth()->check();
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get the validation rules that apply to the request.
|
||
|
|
*
|
||
|
|
* @return array<string, mixed>
|
||
|
|
*/
|
||
|
|
public function rules()
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
// * Dossier
|
||
|
|
'd' => 'sometimes|numeric',
|
||
|
|
// * Sujet
|
||
|
|
's' => 'sometimes|exists:sujets,codeSujet',
|
||
|
|
// * text search
|
||
|
|
't' => 'sometimes|string',
|
||
|
|
// * Recherche
|
||
|
|
'r' => 'sometimes|exists:recherches,id'
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|