Home Articles

laravel中不存在Error-Class

Asked
Viewed 1127 times
0

我收到以下错误

ReflectionException(-1)类impersonate不存在

我已经在UserController.php中定义了模拟函数,文件在App \ Http \ Controllers中 .

<?php

 namespace App\Http\Controllers;

use Illuminate\Http\Request;
 use App\User;
 use Session;
 use Auth;

 public function impersonate(Request $request)

我有我的路线

Route::post('/users/impersonate', ['uses' => 'UserController@impersonate', 'as' => 'users.impersonate'])->middleware('impersonate:web');

1 Answer

  • 0

    确保您有一个名为 impersonate 的中间件,注册在 app/Http/Kernel.php

Related