承接 kgalanos/filament-user 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

kgalanos/filament-user

最新稳定版本:2.0.0

Composer 安装命令:

composer require kgalanos/filament-user

包简介

Add option to filamentphp to login with username or email

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Add fields ulid(do not remove id),username,phone and phone_verified_at to User Model and you may login with username/email in filamentphp panel. Also installs and configure

        "alperenersoy/filament-export": "*",
        "stechstudio/filament-impersonate": "^3.0",
        "bezhansalleh/filament-shield": "*"

Installation

You can install the package via composer:

composer require kgalanos/filament-user

You can publish and run the migrations with:

php artisan vendor:publish --tag="filament-user-migrations"
php artisan migrate

You can update Model User in config\auth.php with:

'model' => \Kgalanos\FilamentUser\Models\User::class,

or you can update

App\Models\User
with
class User extends \Kgalanos\FilamentUser\Models\User implements FilamentUser
{
    use HasFilamentShield, HasRoles;
     /**
     * The attributes that are mass assignable.
     *
     * @var array<int, string>
     */
    protected $fillable = [
        'name',
        'email',
        'password',
        'username',
        'avatar_url',
        'phone',
    ];
.....
}

Install the Filament Panel Builder by running

php artisan filament:install --panels

You can update App\Providers\Filament\AdminPanelProvider with:

            ->login(\Kgalanos\FilamentUser\Filament\Pages\Auth\Login::class)
            ->registration(\Kgalanos\FilamentUser\Filament\Pages\Auth\Register::class)
            ->passwordReset()
            ->profile(\Kgalanos\FilamentUser\Filament\Pages\Auth\EditProfile::class)

            ->discoverPages(base_path('vendor/kgalanos/filament-user/src/Filament/Pages'),'Kgalanos\\FilamentUser\\Filament\\Pages')

You can publish the config file with:

php artisan vendor:publish --tag=filament-shield-config
php artisan vendor:publish --tag="filament-user-config"

This is the contents of the published config file:

return [
];

For the Shield

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            \BezhanSalleh\FilamentShield\FilamentShieldPlugin::make()
        ]);
}
php artisan shield:install

If there is no user id DB it ask you to create an admin.

php artisan make:filament-resource User 

change the App\Filament\Resources

class UserResource extends \Kgalanos\FilamentUser\Filament\Resources\UserResource
{

    protected static ?string $model = App\Models\User::class;
    
    public static function form(Form $form): Form
    {
        $form= parent::form($form);
        return $form;
    }

    public static function table(Table $table): Table
    {
        $table=parent::table($table);
        return $table;
    }
}

Optionally you can use Kgalanos\FilamentUser\Filament\Widgets\ApplicationInfoWidget update App\Providers\Filament\AdminPanelProvider with:

            ->widgets([
                Widgets\AccountWidget::class,
//                Widgets\FilamentInfoWidget::class,
                ApplicationInfoWidget::class,
            ])

Optionally, you can publish the views,if you use ApplicationInfoWidget::class you have to publish the views
using

php artisan vendor:publish --tag="filament-user-views"

Usage

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固