ldc-doux/app/Http/Requests/UpdateProductRequest.php
2021-12-24 15:58:59 +01:00

28 lines
647 B
PHP

<?php
namespace App\Http\Requests;
class UpdateProductRequest extends StoreProductRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
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'
],
]
);
}
}