承接 bitfumes/api-auth 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bitfumes/api-auth

Composer 安装命令:

composer require bitfumes/api-auth

包简介

Your Package Description here

README 文档

README

Software License GitHub issues Total Downloads Build Status

Install

composer require bitfumes/api-auth

Steps to follow

Steps 1

  1. Add Contract hasApiAuth and JWTSubject to your authenticatable model like shown below:
  2. Add ApiAuth trait to your user model.
use Bitfumes\ApiAuth\Traits\ApiAuth;
use Tymon\JWTAuth\Contracts\JWTSubject;
use Bitfumes\ApiAuth\Contract\HasApiAuth;

class User extends Authenticatable implements HasApiAuth, JWTSubject
{
    use Notifiable, ApiAuth;
    ...
}

Step 2

Configure your config/auth.php file to update guard details

  • Update default guard to api
'defaults' => [
        'guard'     => 'api',
        ...
    ],
  • Update api guard to 'jwt'
'guards' => [
        ... ,

        'api' => [
            'driver'   => 'jwt',
            ...
        ],
    ],

Step 3

Add new accessor to your authenticatable model

public function setPasswordAttribute($value)
{
    $this->attributes['password'] = bcrypt($value);
}

Step 4

Now publish two new migrations

  1. To add avatar field to your use model.
  2. To add social login profile.
php artisan vendor:publish --tag=api-auth:migrations

Step 5

After getting migrations in your laravel application, its time to have these tables in your database.

php artisan migrate

Step 6

Because every user need to verify its email and to send email we are going to use laravel queue.

Now add queue driver on your .env file

That's it, now enjoy api auth with JWT

QUEUE_DRIVER=database

Testing

Run the tests with:

vendor/bin/phpunit

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security-related issues, please email sarthak@bitfumes.com instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 225
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 0
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-07-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固