Laravel / Lumen Sentinel设置

时间:2018-01-19 15:59:00

标签: php laravel lumen sentinel

如何在Lumen上设置Sentinel?起初,我得到了

  

未找到“Sentinel”类

然后我注册了Sentinel并创建了一个别名,如下所示:

$app->register(Cartalyst\Sentinel\Laravel\SentinelServiceProvider::class);
class_alias(Cartalyst\Sentinel\Laravel\Facades\Sentinel::class, 'Sentinel');

但我得到了

  

类session.store不存在

然后我也像这样注册了会话:

$app->register(Illuminate\Session\SessionServiceProvider::class);
class_alias(Illuminate\Support\Facades\Session::class, 'Session');
然后我得到了:

  

缺少Illuminate \ Support \ Manager :: createDriver()的参数1,在第88行的/Applications/MAMP/htdocs/projects/gexd/zeno-new/mobile/vendor/illuminate/support/Manager.php中调用,定义

1 个答案:

答案 0 :(得分:0)

运行composer require cartalyst/sentinel "2.0.*"后,在config / app.php中注册。在提供程序中使用Cartalyst\Sentinel\Laravel\SentinelServiceProvider::class,和别名部分使用 'Activation' => Cartalyst\Sentinel\Laravel\Facades\Activation::class, 'Reminder' => Cartalyst\Sentinel\Laravel\Facades\Reminder::class, 'Sentinel' => Cartalyst\Sentinel\Laravel\Facades\Sentinel::class,。您可以看到更多sentinel。如果涵盖了这些步骤。可能忘了在控制器顶部使用use Sentinel;