Reputation: 405
I am upgrading my project to Laravel 9. However, when I tried to run php artisan
, I got an error message.
In Auth.php line 60: To use the Auth::routes() method, please install the laravel/ui package.
So I install the package, but I still get the same error message. What might be the problem, and how can I fix it?
Upvotes: 8
Views: 41168
Reputation: 1
Auth::routes() just insert authentication route to web.php, you could insert authentication route to web.php manually and do not use Auth::routes(), however for using Auth::routes() you must install laravel/ui package.
Upvotes: 0
Reputation: 35
you can just run composer update
it worked for me
Upvotes: 0
Reputation: 143
It indicates that you need to install the Laravel/ui
package in order to use the Auth::routes()
method.
To resolve this issue, you can follow these steps:
Step 1: Install the laravel/ui
package using Composer
:
composer require laravel/ui
Step 2: Generate authentication scaffolding for it.
For Bootstrap-based scaffolding:
php artisan ui bootstrap --auth
For Vue.js-based scaffolding:
php artisan ui vue --auth
For React-based scaffolding:
php artisan ui react --auth
Step 3: Use Auth::routes()
in routes/web.php
// routes/web.php
use Illuminate\Support\Facades\Route;
// ...
Auth::routes();
// ...
Upvotes: 2
Reputation: 776
Had the same issue but had it working locally but not on the web host. In case you are uploading to a remote server and you can't run composer/artisan make sure to also upload the files in bootstrap/cache
(packages.php and services.php)
Upvotes: 3
Reputation: 786
Step 1: (Install Laravel UI)
composer require laravel/ui
Step 2: (Generate Auth UI)
php artisan ui bootstrap --auth
Also please read the documentation: https://github.com/laravel/ui/blob/3.x/README.md
Upvotes: 13