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
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.
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
其他信息
- 授权协议: MIT
- 更新时间: 2023-02-11
