PHP code example of bugo / filament-er-diagram

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

    

bugo / filament-er-diagram example snippets


use Bugo\FilamentErDiagram\ErDiagramPlugin;

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

ErDiagramPlugin::make()
    ->modelsPath('app/Domain/Models')          // custom directory
    ->excludeModels([PersonalAccessToken::class])
    ->withoutColumns()                          // hide column details
    ->withoutRelationshipLabels()               // hide edge labels
    ->navigationGroup('Developer')
    ->navigationSort(10)
    ->navigationIcon('heroicon-o-table-cells'),
css
> @source '../../../../vendor/bugo/filament-er-diagram/resources/**/*.blade.php';
> 
bash
php artisan vendor:publish --tag="filament-er-diagram-config"
bash
php artisan filament:assets
bash
# Print a table summary
php artisan er-diagram:generate --path=app/Models

# Print clean JSON to stdout
php artisan er-diagram:generate --format=json --path=app/Models

# Save JSON to file
php artisan er-diagram:generate --format=json --output=er-diagram.json

# Exclude specific models
php artisan er-diagram:generate --exclude=App\\Models\\PersonalAccessToken