PHP code example of njxqlus / filament-relation-manager-component

1. Go to this page and download the library: Download njxqlus/filament-relation-manager-component 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/ */

    

njxqlus / filament-relation-manager-component example snippets


public static function form(Form $form): Form
{
    return $form
        ->schema([           
            Forms\Components\Tabs::make()->tabs([
                Forms\Components\Tabs\Tab::make('Versions')->schema([
                    \Njxqlus\Filament\Components\Forms\RelationManager::make()->manager(RelationManagers\VersionsRelationManager::class)->lazy(false)
                ]),
                Forms\Components\Tabs\Tab::make('Stands')->schema([
                    \Njxqlus\Filament\Components\Forms\RelationManager::make()->manager(RelationManagers\StandsRelationManager::class)->lazy(false)
                ]),
                Forms\Components\Tabs\Tab::make('Contexts')->schema([
                    \Njxqlus\Filament\Components\Forms\RelationManager::make()->manager(RelationManagers\ContextsRelationManager::class)->lazy(false)
                ]),
            ])
        ]);
}
    
public static function infolist(Infolist $infolist): Infolist
{
    return $infolist->schema([       
        Infolists\Components\Tabs::make()->tabs([
            Infolists\Components\Tabs\Tab::make('Versions')->schema([
                \Njxqlus\Filament\Components\Infolists\RelationManager::make()->manager(RelationManagers\VersionsRelationManager::class)->lazy(false)
            ]),
            Infolists\Components\Tabs\Tab::make('Stands')->schema([
                \Njxqlus\Filament\Components\Infolists\RelationManager::make()->manager(RelationManagers\StandsRelationManager::class)->lazy(false)
            ]),
            Infolists\Components\Tabs\Tab::make('Contexts')->schema([
                \Njxqlus\Filament\Components\Infolists\RelationManager::make()->manager(RelationManagers\ContextsRelationManager::class)->lazy(false)
            ]),
        ])
    ]);
}
bash
php artisan vendor:publish --tag="filament-relation-manager-component-views"