ldc-crm/app/Http/Requests/Bo/Brands/UpdateBrandRequest.php

38 lines
899 B
PHP
Raw Permalink Normal View History

2023-06-13 09:11:18 +02:00
<?php
2023-10-06 15:00:42 +02:00
namespace App\Http\Requests\Bo\Brands;
2023-06-13 09:11:18 +02:00
class UpdateBrandRequest extends StoreBrandRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules(): array
{
/** @var integer $brandModelKey */
$brandModelKey = request()->route()->parameter('brand')->getKey();
$rules = [
'name' => [
'required',
"unique:brands,name,$brandModelKey",
'string',
'min:5',
'max:255',
],
'domain' => [
'required',
"unique:brands,domain,$brandModelKey",
'string',
'min:5',
'max:255',
],
];
return \array_merge(
parent::rules(),
$rules,
);
}
2023-06-13 09:11:18 +02:00
}