PHP code example of afea / filament-users

1. Go to this page and download the library: Download afea/filament-users 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/ */

    

afea / filament-users example snippets


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

class User extends Authenticatable
{
    use HasRoles;
    // ...
}

->plugin(\Afea\Cms\Users\Filament\UsersPlugin::make())

// config/afea-users.php
'models' => [
    'user' => \App\Models\AdminUser::class,
],

namespace Database\Seeders;

use Spatie\Permission\Models\Permission;

class PermissionSeeder extends \Illuminate\Database\Seeder
{
    public function run(): void
    {
        collect(['view_posts', 'create_posts', 'edit_posts', 'delete_posts'])
            ->each(fn ($name) => Permission::findOrCreate($name, 'web'));
    }
}
bash
php artisan shield:install admin
php artisan shield:generate --all --panel=admin