### Installing Filament Modal Relation Managers (Bash) Source: https://github.com/guavacz/filament-modal-relation-managers/blob/main/README.md This command uses Composer to install the `guava/filament-modal-relation-managers` package, adding it as a dependency to your project. ```bash composer require guava/filament-modal-relation-managers ``` -------------------------------- ### Running Package Tests (Bash) Source: https://github.com/guavacz/filament-modal-relation-managers/blob/main/README.md This command executes the package's test suite using Composer's `test` script, typically defined in the `composer.json` file. ```bash composer test ``` -------------------------------- ### Using RelationManagerAction in Filament Table (PHP) Source: https://github.com/guavacz/filament-modal-relation-managers/blob/main/README.md Demonstrates how to add a `RelationManagerAction` to the actions of a Filament resource table. It creates an action labeled 'View lessons' that opens the specified `LessonRelationManager` in a modal for the current record. ```php use Guava\FilamentModalRelationManagers\Actions\Table\RelationManagerAction; // for example in a resource table class CourseResource extends Resource { // ... public static function table(Table $table): Table { return $table ->actions([ RelationManagerAction::make('lesson-relation-manager') ->label('View lessons') ->relationManager(LessonRelationManager::make()), ]) // ... ; } // ... } ``` -------------------------------- ### Using RelationManagerAction in Filament Infolist (PHP) Source: https://github.com/guavacz/filament-modal-relation-managers/blob/main/README.md Shows how to attach a `RelationManagerAction` as a suffix action to a `TextEntry` within a Filament resource infolist schema. The action opens the specified relation manager in a modal for the current record. ```php use Guava\FilamentModalRelationManagers\Actions\Infolist\RelationManagerAction; // for example in a resource infolist class CourseResource extends Resource { // ... public static function infolist(Infolist $infolist): Infolist { return $infolist ->schema([ TextEntry::make('title') ->suffixAction(RelationManagerAction::make() ->label('View lessons') ->relationManager(LessonRelationManager::make())) ]) // ... ; } // ... } ``` -------------------------------- ### Configuring Tailwind CSS for Assets (JavaScript) Source: https://github.com/guavacz/filament-modal-relation-managers/blob/main/README.md Adds the package's resource path to the `content` property in your custom Filament theme's `tailwind.config.js`. This ensures that the package's CSS overrides are included when building your theme. ```javascript export default { //... content: [ // ... './vendor/guava/filament-modal-relation-managers/resources/**/*.blade.php' ] } ``` -------------------------------- ### Using RelationManagerAction in Filament Edit Page Header (PHP) Source: https://github.com/guavacz/filament-modal-relation-managers/blob/main/README.md Illustrates how to include a `RelationManagerAction` in the header actions of a Filament edit page. The action is associated with the current record and opens the specified relation manager in a modal. ```php use Guava\FilamentModalRelationManagers\Actions\Action\RelationManagerAction; // for example in edit page class EditCourse extends EditRecord { // ... protected function getHeaderActions(): array { return [ RelationManagerAction::make() ->label('View lessons') ->record($this->getRecord()) ->relationManager(LessonRelationManager::make()) ]; } // ... } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.