Skip to content

tomatophp/filament-users

Repository files navigation

Screenshot

Filament users

Latest Stable Version PHP Version Require License Downloads

User Resource For FilamentPHP Admin Dashboard

Screenshots

Users List Edit User Users Filters

Installation

composer require tomatophp/filament-users

finally reigster the plugin on /app/Providers/Filament/AdminPanelProvider.php

->plugin(\TomatoPHP\FilamentUsers\FilamentUsersPlugin::make())

Use Filament Shield

you can use the shield to protect your resource and allow user roles by install it first

composer require bezhansalleh/filament-shield

Add the Spatie\Permission\Traits\HasRoles trait to your User model(s):

use Illuminate\Foundation\Auth\User as Authenticatable;
use Spatie\Permission\Traits\HasRoles;

class User extends Authenticatable
{
    use HasRoles;

    // ...
}

Publish the config file then setup your configuration:

->plugin(\BezhanSalleh\FilamentShield\FilamentShieldPlugin::make())

Now run the following command to install shield:

php artisan shield:install

now on your filament-users.php config allow shield

/*
 * User Filament Shield
 */
"shield" => true,

now clear your config

php artisan config:cache

for more information check the Filament Shield

Use Filament Impersonate

you can use the impersonate to impersonate the user by install it first

composer require stechstudio/filament-impersonate

now on your filament-users.php config allow shield

/*
 * User Filament Impersonate
 */
"impersonate" => true,

now clear your config

php artisan config:cache

for more information check the Filament Impersonate

Publish Resource

you can publish the resource to your project

php artisan filament-users:publish

it will publish the resource to your project

than go to filament-users.php config file and change the publish_resource to true

Use Facade Class

you can use the facade class to attach anything to your user resource, in your provider like this

use TomatoPHP\FilamentUsers\Facades\FilamentUser;

public function boot()
{
    FilamentUser::registerAction(\Filament\Actions\Action::make('update'));
    FilamentUser::registerCreateAction(\Filament\Actions\Action::make('update'));
    FilamentUser::registerEditAction(\Filament\Actions\Action::make('update'));
    FilamentUser::registerFormInput(\Filament\Forms\Components\TextInput::make('text'));
    FilamentUser::registerTableAction(\Filament\Tables\Actions\Action::make('update'));
    FilamentUser::registerTableColumn(\Filament\Tables\Columns\Column::make('text'));
    FilamentUser::registerTableFilter(\Filament\Tables\Filters\Filter::make('text'));
}

Publish Assets

you can publish config file by use this command

php artisan vendor:publish --tag="filament-users-config"

you can publish languages file by use this command

php artisan vendor:publish --tag="filament-users-lang"

Other Filament Packages

Support

you can join our discord server to get support TomatoPHP

Docs

you can check docs of this package on Docs

Changelog

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

Security

Please see SECURITY for more information about security.

Credits

License

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