Neeraj1005
1 month ago
440
16
Laravel

BadMethodCallException Method Illuminate\Validation\Validator::validateName does not exist.

Posted 1 month ago by Neeraj1005

Basically I'm trying to update profile information but if there is already username available then validation is not requied but when I try submit the form it throw and validation error. can anyone tell me what wrong with this rule. This is my validation rule....

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class UpdateProfileInfoRequest 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()
    {
        return [
            'name' => 'required|name|unique:users,name,'.$this->id,
            'firstname' => 'required|max:75',
            'lastname' => 'required|max:75',
            //'email' => 'required|email|unique:users,email,'.$this->id
            'mobile_number' => 'string|size:10',
            'address' => 'string|max:255',
            'description' => 'string',
            'profile_photo_path' => 'image|mimes:jpeg,bmp,svg,jpg,png|max:512',
        ];
    }
}

***Both name and email part is send an validation error.

Please sign in or create an account to participate in this conversation.