app/Http/Requests/CustomerRequest.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()
    {
        $customer = $this->route('customer') ? $this->route('customer')->id : 'NULL';
        return [
            'name'      => 'required|string',
            'email'     => 'required|email|unique:customers,email,' . $customer . ',id,user_id,' . Auth::user()->id,
            'phone'     => 'sometimes',
            'address'   => 'sometimes'
        ];
    }
public function rules ( ) { $ customer = $ this -> route ( 'customer' ) ? $ this -> route ( 'customer' ) -> id : 'NULL' ; return [ 'name' => 'required|string' , 'email' => 'required|email|unique:customers,email,' . $ customer . ',id,user_id,' . Auth :: user ( ) -> id , 'phone' => 'sometimes' , 'address' => 'sometimes' ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .
//unique:table,column,except,idColumn