定制 ltsochev/eloquent-devices 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

ltsochev/eloquent-devices

Composer 安装命令:

composer require ltsochev/eloquent-devices

包简介

Allows "remember me" tokens to span across multiple devices

README 文档

README

This package allows your users to be remembered by Laravel across multiple devices.

By default laravel stores the "remember" token in the users table as a singular column, which is an issue when more than one device stores a "remember token"

Installation

Laravel

This package can be used in Laravel 5.4 or higher. It's not tested on older versions as of yet.

You can install the package via composer:

composer require ltsochev/eloquent-devices

Afterwards you'll need to register the service provider in your config/app.php file as follows:

'providers' => [
    // ...
    Ltsochev\Auth\ServiceProvider::class,
]

make sure it's added after Illuminate\Auth\AuthServiceProvider and Illuminate\Session\SessionServiceProvider so that we are certain the Laravel Auth driver is already loaded.

Two more settings need to be added to config/auth.php file.

'token_table' => 'user_tokens',
'driver_name' => 'eloquentdevices',

Once done, you'll have to run migrations for the package

php artisan vendor:publish --provider="Ltsochev\Auth\ServiceProvider" --tag="migrations"
php artisan migrate

And finally, you'll have to replace the auth driver in your auth config file. It's easily done by changing the config/auth.php file accordingly:

//...
'driver' => 'eloquentdevices',

You can change the name of the abstraction by changing the value of driver_name in your config file.

And that's it! Your users will be remembered across multiple devices.

IMPORTANT! The package does not have automated garbage collect as of yet. You'll have to bake in something on your own for this one.

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-03-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固