app/Http/Requests/VendorRequest.php
/**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
Get the validation rules that apply to the request.
@return array
Get the validation rules that apply to the request . @return array
public function rules()
    {
        return [
            'vend-name' => 'required|string|max:100',                           
            'vend-stat' => 'in:0,1',                                            
            'vend-mail' => 'required|email|unique:vendors,email,' .$this->edit,   
            'vend-cate' => 'required|exists:main_cates,id',                     
            'vend_logo' => 'required_without:edit|mimes:jpg,jpeg,png',          
            'vend-mobi' => [
                'required',
                'max:14',
                'regex:/(0)[0-9]/',
                'not_regex:/[a-z]/',
                'min:9',
                'unique:vendors,mobile,' .$this->edit   
            ],   
            'vend-addr' => 'required_without:edit|string|nullable|max:500',     
            'vend-pass' => 'required_without:edit|string|nullable|min:6',       
        ];
    }
public function rules ( ) { return [ 'vend-name' => 'required|string|max:100' , 'vend-stat' => 'in:0,1' , 'vend-mail' => 'required|email|unique:vendors,email,' . $ this -> edit , 'vend-cate' => 'required|exists:main_cates,id' , 'vend_logo' => 'required_without:edit|mimes:jpg,jpeg,png' , 'vend-mobi' => [ 'required' , 'max:14' , 'regex:/(0)[0-9]/' , 'not_regex:/[a-z]/' , 'min:9' , 'unique:vendors,mobile,' . $ this -> edit ] , 'vend-addr' => 'required_without:edit|string|nullable|max:500' , 'vend-pass' => 'required_without:edit|string|nullable|min:6' , ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .
// RULES FOR VENDORS CREATION FORM // VENDOR NAME INPUT // VENDOR STATUS CHECK INPUT // 'vend-mail' => 'sometimes|nullable|email',                       // VENDOR EMAIL INPUT // VENDOR EMAIL INPUT // VENDOR CATEGORY SELECT INPUT // VENDOR LOGO IMAGE INPUT // 'vend-mobi' => 'required|max:14|regex:/(0)[0-9]/|not_regex:/[a-z]/|min:9|unique:vendors,mobile,' .$this->id,   // VENDOR MOBILE INPUT // AS THE HIDDEN INPUT IS NAMED EDIT AND HAS THE ID VALUE // VENDOR MOBILE INPUT // VENDOR ADDRESS INPUT // VENDOR PASSWORD INPUT