ldc-flucollector/app/Http/Requests/Api/V1/XmlIncosIndexRequest.php
Jérémy Munsch 656120f042
TMP
- Arcadia Xml Jobs WIP
- Api WIP
2022-04-11 12:41:44 +02:00

36 lines
727 B
PHP

<?php
namespace App\Http\Requests\Api\V1;
use App\Models\ArcadiaBrand;
class XmlIncosIndexRequest extends PaginatorRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize()
{
$this->merge([
'brand' => $this->brand ? ArcadiaBrand::whereId($this->brand)->firstOrFail() : null
]);
return auth()->check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return \array_merge(
parent::rules(),
[
'brand' => 'nullable'
]
);
}
}