【发布时间】:2018-03-14 20:30:04
【问题描述】:
由于 Laravel 5.5.36 的某些原因,我无法创建 Laravel 框架可识别的 Trait。
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\LedaAuth\Authenticate\LoginController;
use Illuminate\Support\Facades\Auth;
use LedaAuth\Authenticate\LedaAuthenticate;
class LgStfController extends LoginController
{
use LedaAuthenticate;
/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = '/dashboard';
...
Laravel 报错说 "Trait 'Something\Authenticate\LedaAuthenticate' not found". 尽管我的树是
- Controllers
+ Auth
- LedaAuth
- Authenticate
> LedaAuthenticate.php
> LoginController.php
> LgStfController.php
是不是我做错了什么?
【问题讨论】:
-
你的树中有一个错字,
LedaAuthenicate而不是LedaAuthenticate -
@Liora 我的错,我修好了。我正在使用 PhpStorm,所以它一直对我有帮助。