How can I set up a Sentinel on Lumen? At first, I got
Class 'Sentinel' not found
then I registered Sentinel and created an alias as follows:
$app->register(Cartalyst\Sentinel\Laravel\SentinelServiceProvider::class);
class_alias(Cartalyst\Sentinel\Laravel\Facades\Sentinel::class, 'Sentinel');
but I got
Class session.store does not exist
then I also registered session like so:
$app->register(Illuminate\Session\SessionServiceProvider::class);
class_alias(Illuminate\Support\Facades\Session::class, 'Session');
then I got:
Missing argument 1 for Illuminate\\Support\\Manager::createDriver(), called in /Applications/MAMP/htdocs/projects/gexd/zeno-new/mobile/vendor/illuminate/support/Manager.php on line 88 and defined.
After running composer require cartalyst/sentinel "2.0.*"
, register it in config/app.php
.
In providers use:
Cartalyst\\Sentinel\\Laravel\\SentinelServiceProvider::class,
And in alias section use : 'Activation' => Cartalyst\\Sentinel\\Laravel\\Facades\\Activation::class, 'Reminder' => Cartalyst\\Sentinel\\Laravel\\Facades\\Reminder::class, 'Sentinel' => Cartalyst\\Sentinel\\Laravel\\Facades\\Sentinel::class,
You can see more sentinel . If covered these steps. Then maybe you forgot to use use Sentinel;
at the top of your controller.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.