smashed-egg/laravel-in-memory-auth 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

smashed-egg/laravel-in-memory-auth

最新稳定版本:1.2.1

Composer 安装命令:

composer require smashed-egg/laravel-in-memory-auth

包简介

This package allows you to Authenticate an admin area without the need for a database.

README 文档

README

Laravel In Memory Auth Provider

Latest Stable Version Downloads this Month

An In Memory User Auth Provider for Laravel 9+.

Allows you to Authenticate an 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.

Requirements

  • PHP 8.0.2+
  • Laravel 9.0+

Installation

To install this package please run:

composer require smashed-egg/laravel-in-memory-auth

Support Me

Do you like this package? Does it improve you're development. Consider sponsoring to help with future development.

Buy me a coffee!

Thank you!

Configuration

Setup config

In the auth.php config file you will need to set the driver:

'driver' => 'memory',

Add also setup your in memory users:

'memory' => [
    'driver' => 'memory',
    'model' => \SmashedEgg\LaravelInMemoryAuth\User::class,
    'username_field' => 'email',
    'users' => [

        /*
         'me@email.com' => [
            'id' => 1,
            'name' => 'My name',
            // Hashed password using the hasher service
            'password' => 'hashed_password',
        ],
         */

        'admin@example.com' => [
            'id' => 1,
            'email' => 'admin@example.com',
            'name' => 'Barry Allen'
            // Hashed password using the hasher service
            'password' => '$2y$10$Mfusxb1546MFxQ4A1s4GE.OF/gFuI8Y6Hw9xnlZeiHtjDl0/pnXPK',
            'remember_token' => '',
        ],
    ],
],

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 smashed-egg:hash:password mypassword

Contributing

Contributing is welcome. Please see our guide here.

License

This package is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-11