Weave 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

Filament Multi Widget Laravel Package

vodafoneziggonl/filament-multi-widget

View on GitHub
Deep Wiki
Context7

Combine multiple widgets into one

Latest Version Total Downloads

This package adds a new type of widget to your Filament application. The Multi Widget allows you to combine multiple widgets into a single widget, that can be switched using tabs. This plugin helps clean up your Filament dashboard.

Installation

This package can be installed via Composer:

composer require vodafoneziggonl/filament-multi-widget
Package version Supported Filament version
5.x ^5.0
3.x ^4.0

Usage

Create a new Multi Widget by extending the VodafoneZiggoNL\MultiWidget\MultiWidget class.

// app/Filament/Widgets/UserMultiWidget.php

class UserMultiWidget extends MultiWidget
{
    public array $widgets = [
        MySubmittedComments::class,
        MySubmittedFeedback::class,
        MySubscriptions::class,
    ];
}

The $widgets property contains the classes of all the widgets that should be added to your Multi Widget. These are normal Filament widgets that you created.
The Multi Widget above will now render as follows:

In case your widget is displayed a second time on the dashboard, make sure the widget is not automatically added to the dashboard again. Check the discoverWidgets() function in your adminPanelProvider.php file.

Using custom labels for tabs

By default, the label name is generated based on the class name. If you want to customize the label for the tab, add the getDisplayName() method to your widget.

// app/Filament/Widgets/ProductSales.php

class ProductSales extends BaseWidget
{
   // Some widget content...
   
    public function getDisplayName(): string {
        return "Custom name";
    }
}

Persist tabs in session

To persist the tabs in the user's session, use the shouldPersistMultiWidgetTabsInSession() method:

// app/Filament/Widgets/UserMultiWidget.php

class UserMultiWidget extends MultiWidget
{
    public array $widgets = [
        MySubmittedComments::class,
        MySubmittedFeedback::class,
        MySubscriptions::class,
    ];
    
    public function shouldPersistMultiWidgetTabsInSession(): bool
    {
        return true;
    }
}

Contributing

Please see CONTRIBUTING for details.

Credits

License

The Apache License 2.0. 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.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package