定制 tomgrohl/laravel-memory-auth-provider 二次开发

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

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

tomgrohl/laravel-memory-auth-provider

最新稳定版本:1.0.1

Composer 安装命令:

composer require tomgrohl/laravel-memory-auth-provider

包简介

Laravel In memory auth provider.

README 文档

README

Latest Stable Version Latest Unstable Version License

Laravel Memory Auth Provider

A In Memory User Auth Provider for Laravel 5.1+.

Allows you to Authenticate and admin area without the need for a database. Great as a quick and temporary solution during development, particularly if your site is mocked out and not let using a database.

Installation

You can install it using composer:

composer require tomgrohl/laravel-memory-auth-provider

Configuration

1 .Add service provider

Add the following to your providers in the app config

<?php

return [
    
    //...
    
    'providers' => [
        //...    
        'Tomgrohl\Laravel\Auth\AuthServiceProvider',
        
        // OR
        \Tomgrohl\Laravel\Auth\AuthServiceProvider::class,
    ]
    
    
];

2. Setup config

In the auth config you will need to set the driver:

    'driver' => 'memory',

Add also setup your in memory users:

    'memory' => [
        'model' => 'Illuminate\Auth\GenericUser',
        'users' => [
    
            'admin' => [
                'id' => 1,
                // Hashed passord using the hasher service
                'password' => '$2y$10$Mfusxb1546MFxQ4A1s4GE.OF/gFuI8Y6Hw9xnlZeiHtjDl0/pnXPK',
            ],
        ],
    ],

You can add any properties you want making it easy to switch out the Auth drivers.

The package comes with a command for hashing passwords, making it easier to setup passwords, just run the following command to hash your password:

php artisan tomgrohl:hash:password mypassword

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-04-04