24 lines
546 B
PHP
24 lines
546 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Requests\Bo\CodesEan;
|
||
|
|
|
||
|
|
class UpdateCodeEanRequest extends StoreCodeEanRequest
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Get the validation rules that apply to the request.
|
||
|
|
*
|
||
|
|
* @return array
|
||
|
|
*/
|
||
|
|
public function rules()
|
||
|
|
{
|
||
|
|
return \array_merge(parent::rules(), [
|
||
|
|
'code' => [
|
||
|
|
'required',
|
||
|
|
'numeric',
|
||
|
|
'unique:code_eans,code,' . $this->route('code_ean')->id . ',id',
|
||
|
|
'regex:/^[0-9]{7}$|^[0-9]{8}$|^[0-9]{13}$/',
|
||
|
|
],
|
||
|
|
]);
|
||
|
|
}
|
||
|
|
}
|