sun/laravel-auth

Sun Auth 包帮助您保护您的应用程序免受未经授权的用户。

v1.0 2015-07-16 13:28 UTC

This package is auto-updated.

Last update: 2024-09-08 17:22:25 UTC


README

Total Downloads Latest Stable Version Latest Unstable Version License

Sun Auth 包帮助您保护您的应用程序免受未经授权的用户。

安装过程

为了安装 Sun Auth,只需将以下内容添加到您的 composer.json 中。

 "sun/laravel-auth": "1.*"

然后运行 composer install 或 composer update。

然后在您的 config/app.php 中添加

 Sun\Auth\AuthServiceProvider::class,

到 providers 数组中。

在 config/session.php 中将 'expire_on_close' 设置为 true。

 'expire_on_close' => true,

您需要在您的用户表中添加三个额外的列来使用此包。

$table->string('tempPassword', 60);
$table->boolean('active');
$table->string('code', 32);

在您的用户迁移文件中添加以下 3 行代码。然后,运行

php artisan migrate:refresh

然后使用以下命令发布 Sun Auth 的资源

php artisan vendor:publish

此命令将发布所有资源、视图和配置文件。

更改 Sun Auth 默认配置

您还可以更改 Sun Auth 的默认配置。在 config/SunAuth.php 中设置应用程序名称、URL、favicon 链接、用户模型命名空间。

return [
    'app'  => [
        'name' => 'My Awesome App',
        'url'   => 'http://localhost:8000',
        'favicon-url' => 'http://myawesomeapp.com/favicon.png'
    ],
    'user-model-namespace'  => 'App\User',
    'redirect-after-login'  => '/'
];

屏幕截图

登录

Login

注册

Register

注册成功

Register Success

确认电子邮件

Confirmation Email

密码重置

Password Reset

新密码确认电子邮件

New Password Confirmation Email

许可证

此软件包根据 MIT 许可证 许可。