Neaktuální

Čtete dokumentaci k verzi 2.x. Aktuální je 3.x.

Přejít na dokumentaci 3.x →

Usage

Since filament 4 unified its actions, there is a single RelationManagerAction class that works everywhere: tables, schemas (forms and infolists) and page actions.

In a table

use Guava\FilamentModalRelationManagers\Actions\RelationManagerAction;

return $table
    ->recordActions([
        RelationManagerAction::make('lesson-relation-manager')
            ->label('View lessons')
            ->relationManager(LessonRelationManager::class),
    ]);

In a schema

use Guava\FilamentModalRelationManagers\Actions\RelationManagerAction;

TextEntry::make('title')
    ->suffixAction(
        RelationManagerAction::make()
            ->label('View lessons')
            ->relationManager(LessonRelationManager::class),
    );

As a page action

use Guava\FilamentModalRelationManagers\Actions\RelationManagerAction;

protected function getHeaderActions(): array
{
    return [
        RelationManagerAction::make()
            ->label('View lessons')
            ->record($this->getRecord())
            ->relationManager(LessonRelationManager::class),
    ];
}

Customization

Hide the relation manager's heading inside the modal (it is hidden by default):

RelationManagerAction::make()
    ->hideRelationManagerHeading();

Use the compact style, which removes the padding around the table so it touches the modal's edge:

RelationManagerAction::make()
    ->compact();
guava/filament-modal-relation-managers 86K instalací · 79 hvězd
// COOKIES

Pár cookies drží web v chodu; další si pamatují nastavení nebo počítají návštěvy. Vy rozhodujete, co poběží.

Zásady cookies