某种已安装的哨兵(我之所以这么说是因为我不明白其中的一段话:
Sentinel 附带了照明/数据库的默认实现,为了使用它,请确保在 composer.json 文件中需要它。
// 导入必要的类
use Cartalyst\Sentinel\Native\Facades\Sentinel;
use Illuminate\Database\Capsule\Manager as Capsule;
// 包含作曲家自动加载文件
require 'vendor/autoload.php';
问题 1:我在哪里编写该代码?
问题 2:,我现在最关心的是如何从中做出一些事情,关于注册、激活等。我本来希望创建一个链接,该链接将发送到您的电子邮件中,单击它即可激活它。但我只能看到它说的是:
$credentials = [
'email' => 'john.doe@example.com',
'password' => 'password',
];
$user = Sentinel::register($credentials);
or if Also activate:
$credentials = [
'email' => 'john.doe@example.com',
'password' => 'password',
];
$user = Sentinel::registerAndActivate($credentials);
当我得到输入时,我应该把它写在控制器中吗?那么电子邮件激活呢?