23 lines
491 B
PHP
23 lines
491 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Requests;
|
||
|
|
|
||
|
|
use Illuminate\Foundation\Http\FormRequest;
|
||
|
|
|
||
|
|
class UpdateRecipe extends StoreRecipe
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Get the validation rules that apply to the request.
|
||
|
|
*
|
||
|
|
* @return array
|
||
|
|
*/
|
||
|
|
public function rules()
|
||
|
|
{
|
||
|
|
$rules = [];
|
||
|
|
if ($this->recipe->picture) {
|
||
|
|
$rules['picture'] = 'image|mimes:jpeg,png,jpg|max:2048|dimensions:width=683,height=434';
|
||
|
|
}
|
||
|
|
return array_merge(parent::rules(), $rules);
|
||
|
|
}
|
||
|
|
}
|