PHP code example of zynqa / filament-confluence

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

    

zynqa / filament-confluence example snippets


use Zynqa\FilamentConfluence\Models\Concerns\HasConfluenceSpaces;

class User extends Authenticatable
{
    use HasConfluenceSpaces;

    protected $fillable = [
        // ... your existing fields
        'confluence_space_keys',
    ];
}

use Zynqa\FilamentConfluence\FilamentConfluencePlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            FilamentConfluencePlugin::make(),
        ]);
}

Forms\Components\Select::make('confluence_space_keys')
    ->label('Confluence Spaces')
    ->multiple()
    ->options(function () {
        $service = app(\Zynqa\FilamentConfluence\Services\ConfluenceService::class);
        $spaces = $service->getSpaces();

        return collect($spaces)->mapWithKeys(fn($s) => [
            $s['key'] => $s['key'] . ' - ' . $s['name']
        ]);
    })
    ->searchable(),
bash
php artisan vendor:publish --tag="filament-confluence-config"
php artisan vendor:publish --tag="filament-confluence-migrations"
bash
php artisan migrate