kda/filament-wimdy
最新稳定版本:4.0.3
Composer 安装命令:
composer require kda/filament-wimdy
包简介
README 文档
README

about
it's an extension for jeffgreco13/filament-breezy that brings two features
1: force the user to change his password
2: disable user accounts without deleting them
Installation
You can install the package via composer:
breezy
php artisan vendor:publish --tag="filament-breezy-config"
php artisan vendor:publish --tag="filament-breezy-migrations"
You will have to publish and run the migrations with:
php artisan vendor:publish --provider="KDA\Filament\Wimdy\ServiceProvider" --tag="migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --provider="KDA\Filament\Wimdy\ServiceProvider" --tag="config"
This is the contents of the published config file:
<?php
// config for KDA/Filament\Wimdy
return [
'middleware'=>[
'exceptions'=>[
'/admin/password/reset'
]
],
'password_forcereset_component_path'=> \KDA\Filament\Wimdy\Http\Livewire\Auth\ForceResetPassword::class
];
Filament
change your filament auth config to
'auth' => [
'guard' => env('FILAMENT_AUTH_GUARD', 'web'),
'pages' => [
'login' => \KDA\Filament\Wimdy\Http\Livewire\Auth\Login::class,
],
],
and add \KDA\Filament\Wimdy\Middleware\ForcePasswordChange::class to your filament middleware like
'middleware' => [
'auth' => [
Authenticate::class,
\KDA\Filament\Wimdy\Middleware\ForcePasswordChange::class
],
// rest of the config
]
User Model
add 'force_password_change' and 'enabled' to your fillable attributes
protected $fillable = ['name', 'email', 'password','force_password_change','enabled'];
Admin panel
Just add two toggles to your UserResource Form
Forms\Components\Toggle::make('enabled')->default(true),
Forms\Components\Toggle::make('force_password_change')->default(true)
Just add two columns to your table
BooleanColumn::make('enabled'),
BooleanColumn::make('active')
->getStateUsing(fn ($record): bool => ($record->force_password_change && !blank($record->password_changed_on) || !$record->force_password_change) )
->trueColor(fn($record):string => !$record->force_password_change ? 'secondary': 'success'),
Credits
License
The MIT License (MIT). Please see License File for more information.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
统计信息
- 总下载量: 362
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-08-03