ldc-domaine-de-lanvaux/app/Http/Requests/UpdateProductRequest.php

29 lines
654 B
PHP
Raw Permalink Normal View History

2022-08-05 09:38:44 +00:00
<?php
namespace App\Http\Requests;
class UpdateProductRequest extends StoreProductRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules(): array
{
return array_merge(
parent::rules(),
[
'slug' => 'required|unique:products,slug,' . $this->product->id,
'picture' => [
'sometimes',
'image',
'mimes:png',
'max:1024',
'dimensions:width=509,height=509'
],
]
);
}
}