Edit File: Store.php
<?php namespace App\Http\Requests\Admin\Brand; 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 [ 'name_ar' => 'required|max:50' , 'name_en' => 'required|max:50' , 'brand' => "required|unique:hyperpay_brands,brand,{$this->id}" , 'image' => 'nullable|image' , 'entity_id' => 'required' , 'is_active' => 'required' , ]; }else{ return [ 'name_ar' => 'required|max:50' , 'name_en' => 'required|max:50' , 'brand' => 'required|unique:hyperpay_brands,brand' , 'image' => 'required|image' , 'entity_id' => 'required' , 'is_active' => 'required' , ]; } } }
Back to File Manager