55 lines
1.1 KiB
PHP
55 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\ProntoAtendimento\PedidoExame;
|
|
|
|
use App\Http\Requests\FormRequest;
|
|
|
|
class LaudoRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function authorize()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
switch($this->method()) {
|
|
case 'POST':
|
|
return $this->getPostRules();
|
|
|
|
default:
|
|
return [];
|
|
}
|
|
|
|
}
|
|
|
|
private function getPostRules() {
|
|
return [
|
|
'arquivo' => [
|
|
'required',
|
|
'array',
|
|
],
|
|
'arquivo.*' => [
|
|
'distinct',
|
|
'mimes:doc,pdf,png,jpeg',
|
|
'max:2048',
|
|
],
|
|
'pedido_exame_id' => [
|
|
'required',
|
|
'integer',
|
|
'exists:\App\Models\ProntoAtendimento\PedidoExame\PedidoExame,id'
|
|
]
|
|
];
|
|
}
|
|
}
|