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

36 lines
895 B
PHP
Raw Permalink Normal View History

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