Edit File: Store.php
<?php namespace App\Http\Requests\Admin\Sponser; use Illuminate\Foundation\Http\FormRequest; class Store extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true ; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { if ($this->getMethod() === 'PUT') { return [ 'image' => 'nullable|mimes:jpg,jpeg,svg,png' , 'name' => 'required' , 'url' => 'required|url' , ]; }else{ return [ 'image' => 'required|mimes:jpg,jpeg,svg,png' , 'name' => 'required' , 'url' => 'required|url' , ]; } } }
Back to File Manager