njxqlus/filament-relation-manager-component

Use Filament Relation Manager Everywhere!

1.0.2 2024-05-26 23:02 UTC

This package is auto-updated.

Last update: 2024-12-08 05:29:41 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

banner

Use Filament Relation Manager Everywhere!

Installation

You can install the package via composer:

composer require njxqlus/filament-relation-manager-component

Optionally, you can publish the views using

php artisan vendor:publish --tag="filament-relation-manager-component-views"

Usage

Example below shows how to use different relation managers in tabs without lazy load.

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)
            ]),
        ])
    ]);
}

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.