36 lines
727 B
PHP
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'
|
|
]
|
|
);
|
|
}
|
|
}
|