User Table Resource with a lot of packages integrations
for v2 please use this repo
composer require tomatophp/filament-users
finally reigster the plugin on /app/Providers/Filament/AdminPanelProvider.php
->plugin(\TomatoPHP\FilamentUsers\FilamentUsersPlugin::make())
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 we can publish the package assets.
php artisan vendor:publish --tag="filament-users-config"
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
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
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
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'));}
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"
Checkout our Awesome TomatoPHP