Search code examples
phpeloquentlaravel-authenticationlaravel-6.2

Laravel 6.2 Authentification Error : LoginController does not exist


I'm beginner in laravel framework so I don't understand lot of thing in laravel for the moment.

So, I have try to create an simple authentication system.

But when I try to use the form I have this error :

Illuminate\Contracts\Container\BindingResolutionException
Target class [Application\Http\Controllers\Auth\LoginController] does not exist.

(you can get the complete error here : https://flareapp.io/share/Bm0AY6Px#F29)

However, the LoginController class exist in my folder so I don't understood what append.

I have write this commands : php artisan ui vue --auth And i have configured my database, the only change that I have made is on the migrate of user table. My user up function look like that :

public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('email')->unique();
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password');
            $table->string('nom');
            $table->string('prenom');
            $table->string('telephone',10);
            $table->string('adresse');
            $table->rememberToken();
            $table->timestamps();
        });
    }

To solve that, I have try to :

  • reinstall the projet with auth flag like that: composer create-project --prefer-dist laravel/laravel myprojet --auth.
  • Init nodejs like that : npm install and npm run dev
  • Don't change the user migrate file.

So if you can help me and explain how this auth system work that will be realy helpful for me.


Solution

    1. composer require laravel/ui

    2. php artisan ui vue or php artisan ui react

    https://readouble.com/laravel/6.x/en/frontend.html