Duong Nguyen Duong Nguyen - 13 days ago 5
PHP Question

php artisan make:auth does not create auth controllers after deleting

So I am working with Laravel authentication, first time it works perfectly but after deleting Auth folder, I run php artisan make:auth again but it does not create another Auth folder. The view and model part still runs well. Is there anyway to take it back?

Answer

The command is not supposed to generate auth controllers for you. It generates appropriate auth views, routes and a HomeController. Quoting from the docs:

php artisan make:auth

This command should be used on fresh applications and will install a layout view, registration and login views, as well as routes for all authentication end-points. A HomeController will also be generated to handle post-login requests to your application's dashboard.

If the code is under git, you can simply restore your deleted files:

git checkout <commit> app/Http/Controllers/Auth/AuthController.php

Or you can simply get your new copy from Laravel's repo:

wget -O app/Http/Controllers/Auth/AuthController.php https://raw.githubusercontent.com/laravel/laravel/5.1/app/Http/Controllers/Auth/AuthController.php
Comments