PHP code example of kgalanos / filament-user

1. Go to this page and download the library: Download kgalanos/filament-user library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kgalanos / filament-user example snippets


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

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',
    ];
.....
}

            ->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')

return [
];

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

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;
    }
}

            ->widgets([
                Widgets\AccountWidget::class,
//                Widgets\FilamentInfoWidget::class,
                ApplicationInfoWidget::class,
            ])
bash
php artisan vendor:publish --tag="filament-user-migrations"
bash
php artisan migrate
bash
php artisan filament:install --panels
bash
php artisan vendor:publish --tag=filament-shield-config
bash
php artisan vendor:publish --tag="filament-user-config"
bash
php artisan shield:install
bash
php artisan make:filament-resource User 
bash
php artisan vendor:publish --tag="filament-user-views"