【问题标题】:Laravel/Lumen Sentinel setupLaravel/Lumen Sentinel 设置
【发布时间】:2019-12-31 20:40:17
【问题描述】:

如何在 Lumen 上设置 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 中调用已定义。

【问题讨论】:

标签: php laravel lumen sentinel


【解决方案1】:

运行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;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-08-13
    • 1970-01-01
    • 1970-01-01
    • 2020-05-20
    • 2015-08-13
    • 2021-06-30
    • 1970-01-01
    • 2018-07-09
    相关资源
    最近更新 更多