Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Relation Manager Repeater Laravel Package

zvizvi/relation-manager-repeater

View on GitHub
Deep Wiki
Context7

Filament Relation Manager Repeater

Filament Relation Manager Repeater

Latest Version on Packagist Total Downloads

A Filament plugin that enhances Relation Managers by providing a Repeater interface, enabling efficient inline editing and management of associated records.

Version Compatibility

  • Version 1.x is compatible with Filament 3
  • Version 2.x and above is compatible with Filament 4

Installation

composer require zvizvi/relation-manager-repeater

Usage

Add the RelationManagerRepeaterAction to your relation manager's table actions:

use Zvizvi\RelationManagerRepeater\Tables\RelationManagerRepeaterAction;

class PostsRelationManager extends RelationManager
{
    protected static string $relationship = 'posts';

    public function table(Table $table): Table
    {
        return $table
            ->columns([
                //
            ])
            ->headerActions([
                RelationManagerRepeaterAction::make(),
            ]);
    }
}

Advanced Configuration

Since RelationManagerRepeaterAction extends Filament's Action class, all standard Action configurations are available (label, modalWidth, modalHeading, icon, color, etc.).

You can also customize the repeater component using the configureRepeater method. All standard Filament repeater options are available (reorderable, collapsible, cloneable, grid, itemLabel, etc.):

use Filament\Forms\Components\Repeater;

public function table(Table $table): Table
{
    return $table
        ->columns([
            //
        ])
        ->headerActions([
            RelationManagerRepeaterAction::make()
                ->modalWidth('5xl')
                ->modalHeading('Edit Related Records')
                ->configureRepeater(function (Repeater $repeater) {
                    return $repeater
                        ->reorderable()
                        ->collapsible()
                        ->cloneable()
                        ->defaultItems(0)
                        ->maxItems(5);
                }),
        ]);
}

Form Customization

By default, the repeater uses the form schema defined in your relation manager. You can customize which fields are displayed in the repeater by providing a custom schema:

RelationManagerRepeaterAction::make()
    ->configureRepeater(function (Repeater $repeater) {
        return $repeater
            ->schema([
                // Only include specific fields
                TextInput::make('title'),
                TextInput::make('slug'),
                Toggle::make('is_published'),
                // Other fields...
            ]);
    }),

This allows you to display only a subset of fields from your relation manager's form, or even add custom fields specifically for the repeater interface.

How It Works

The plugin creates a modal with a repeater component that loads all related records. When you save the form:

  • For each record, it determines whether to:
    • Delete records that are no longer present
    • Update existing records with new data
    • Create new records that were added
  • Shows a success notification

This approach provides a clean interface for managing multiple related records at once.

Screenshots

  • Relation manager action button:

  • Action form editor:

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle