infuse/auth

Infuse 框架的认证模块

3.2 2018-01-01 23:28 UTC

This package is auto-updated.

Last update: 2024-09-13 08:03:06 UTC


README

Build Status Coverage Status Latest Stable Version Total Downloads

Infuse 框架的认证模块

安装

  1. 使用 composer 安装此包

    composer require infuse/auth
    
  2. 将服务添加到应用程序配置中的 services

    'services' => [
        // ...
        'auth' => 'Infuse\Auth\Services\Auth'
        // ...
    ]
  3. 将迁移添加到应用程序配置中

    'modules' => [
       'migrations' => [
          // ...
          'Auth'
       ],
       'migrationPaths' => [
          // ...
          'Auth' => 'vendor/infuse/auth/src/migrations'
       ]
    ]
  4. (可选) 将辅助任务的控制台命令添加到应用程序配置中的 console.commands

    'console' => [
        // ...
        'commands' => [
     	   // ...
     	   'Infuse\Auth\Console\ResetPasswordLinkCommand'
        ]
    ]
  5. (可选) 将垃圾收集计划的作业添加到应用程序配置中的 cron

    'cron' => [
       // ...
       [
          'id' => 'auth:garbageCollection',
          'class' => 'Infuse\Auth\Jobs\GarbageCollection',
          'minute' => 30,
          'hour' => 1,
          'day' => 1
       ]
    ]

使用方法

您可以为进一步的定制创建自己的用户模型,位于 App\Users\Models\User