PHP code example of offline-agency / filament-spid

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

    

offline-agency / filament-spid example snippets


$table->string('fiscal_code')->unique()->nullable();
$table->json('spid_data')->nullable();

use OfflineAgency\FilamentSpid\SpidPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->default()
        ->id('admin')
        ->path('admin')
        ->plugin(
            SpidPlugin::make()
                ->spidButtonLabel('Entra con SPID')
                ->providers([
                    'arubaid',
                    'infocertid',
                    'lepidaid',
                    'namirialid',
                    'posteid',
                    'sielteid',
                    'spiditalia',
                    'timid',
                    'teamsystemid'
                ])
        );
}

SpidPlugin::make()
    ->loginView('your-custom-view')

SpidPlugin::make()
    ->loginRoute('custom.spid.login')
    ->logoutRoute('custom.spid.logout')
    ->acsRoute('custom.spid.acs')
    ->metadataRoute('custom.spid.metadata')

SpidPlugin::make()
    ->showSpidButton(false)

SpidPlugin::make()
    ->spidButtonLabel('Login con SPID')
    ->spidButtonIcon('heroicon-o-shield-check')

SpidPlugin::make()
    ->providers(['posteid', 'arubaid', 'infocertid'])

return [
    'user_model' => \App\Models\User::class,
    'redirect_after_login' => '/admin',
    'spid_level' => 'https://www.spid.gov.it/SpidL2',
];

protected $fillable = [
    'name',
    'email',
    'fiscal_code',
    'spid_data',
    // ... other fields
];

protected $casts = [
    'spid_data' => 'array',
];

route('spid.login', ['provider' => 'posteid', 'level' => 'SpidL2'])
bash
php artisan vendor:publish --tag="filament-spid-config"
bash
php artisan vendor:publish --tag="filament-spid-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="filament-spid-views"
bash
php artisan vendor:publish --tag="filament-spid-images"
bash
composer analyse