Laravel - 在路由列表中找不到错误 ResetPasswordController
Laravel - Error ResetPasswordController not found in route list
我在执行命令 php artisan route:list
时出现此错误:
ReflectionException : Class App\Http\Controllers\Auth\ResetPasswordController does not exist
at /Applications/MAMP/htdocs/test/vendor/laravel/framework/src/Illuminate/Container/Container.php:790
在哪里可以查看?我使用 php artisan make:auth
来生成这个文件。
该文件存在于 app/Http/Controllers/Auth/ResetPasswordController.php.
下
这是内容:
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;
class ResetPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset requests
| and uses a simple trait to include this behavior. You're free to
| explore this trait and override any methods you wish to tweak.
|
*/
use ResetsPasswords;
/**
* Where to redirect users after resetting their password.
*
* @var string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
}
路由已缓存,不会获取您的 files/classes
的新版本
所以你需要通过运行
将它们添加到classmap
composer dumpautoload
希望对您有所帮助
我在执行命令 php artisan route:list
时出现此错误:
ReflectionException : Class App\Http\Controllers\Auth\ResetPasswordController does not exist
at /Applications/MAMP/htdocs/test/vendor/laravel/framework/src/Illuminate/Container/Container.php:790
在哪里可以查看?我使用 php artisan make:auth
来生成这个文件。
该文件存在于 app/Http/Controllers/Auth/ResetPasswordController.php.
这是内容:
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;
class ResetPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset requests
| and uses a simple trait to include this behavior. You're free to
| explore this trait and override any methods you wish to tweak.
|
*/
use ResetsPasswords;
/**
* Where to redirect users after resetting their password.
*
* @var string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
}
路由已缓存,不会获取您的 files/classes
的新版本所以你需要通过运行
将它们添加到classmapcomposer dumpautoload
希望对您有所帮助