如何解决Class App \ Http \ Requests \ UpdateUserRequest不存在? laravel 5.3

My code is like this :

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use App\Models\User;

class UpdateUserRequest 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 User::$rules;

        return [
            'username' => 'required|unique:users,username,'. \Auth::user()->id;,
            'email' => 'required|unique:users,email,'. \Auth::user()->id;,
        ];
    }
}

It is a request to update user data

When the code is executed, there is an error like this:

ReflectionException in Route.php line 339: Class App\Http\Requests\UpdateUserRequest does not exist

How to solve the error?

You have syntax errors in both of your rules:

'username' => 'required|unique:users,username,'. \Auth::user()->id;,

Remove the semicolon:

'username' => 'required|unique:users,username,'. \Auth::user()->id,

You may also run into issues if someone happens to submit the form without being logged in, but that may or may not be a concern for you.