Gridstack dashboard
CommunityThis plugin allows you to configure and design your dashboard page using gridstackjs.
Author:
David Vincent
Package health
BetaAutomated checks of this plugin's Composer package
15 checks
- Failed: GitHub Actions pinned to SHA — View details on Plumb
- Skipped: GitLab CI includes pinned to SHA
- Passed: Open security advisories
- Failed: Dependabot PR responsiveness — Stale Dependabot PRs: oldest general PR is 749 days old. View details on Plumb
- Skipped: Renovate MR responsiveness
- Warning: Dependabot or Renovate configured — Updater does not cover the JavaScript ecosystem, which has a committed lockfile.
-
Failed:
Dependency update cooldown configured
—
No cooldown configured in
.github/dependabot.yml. View details on Plumb - Passed: Provides a security policy
- Passed: Abandoned or archived — No consulted source marks the package abandoned (packagist, github).
- Failed: Commit and release recency — Inactive: last commit 787 days ago; last release 787 days ago. View details on Plumb
-
Passed:
composer.lock not committed by library
—
composer.lockis absent from the released dist archive. - Passed: Dist archive is lean
-
Failed:
Current Laravel version supported
—
The newest Laravel line verified to co-install with the package is
11.0, which is end-of-life. Lines13.0,12.0could not be fully verified: no solution was found among the newest package versions, and resolving the complete version pool exceeded solver resource budgets, so support there cannot be ruled out. View details on Plumb -
Passed:
Current PHP version supported
—
Constraint
^8.2supports current PHP8.5. - Skipped: Current Symfony version supported
filament/
namespace. Review the source and install at your own risk. Found
malware or an unresolved security issue the author won't
address?
Report it
.
Documentation
This package allows to add widgets and define the layout of the dashboard page on a per-user basic. This package uses Laravel model settings package to ensure persistence of data in the database.
#Installation
You can install the package via composer:
composer require invaders-xx/filament-gridstack-dashboard
php artisan filament:assets
Note: Add plugin Blade files to your custom theme
tailwind.config.jsfor dark mode.To set up your own custom theme, you can visit the official instruction page on the Filament website.
Add the plugin's views to your tailwind.config.js file.
content: [
'<path-to-vendor>/invaders-xx/filament-gridstack-dashboard/resources/**/*.blade.php',
]
Please visit Laravel model settings to configure your User model to use this package.
You can publish the config file with:
php artisan vendor:publish --tag="filament-gridstack-dashboard-config"
This is the contents of the published config file:
return [
];
There is no option at the moment.
Optionally, you can publish the views using
php artisan vendor:publish --tag="filament-gridstack-dashboard-views"
#Usage
All functions used to configure the plugin can have a closure as argument.
use InvadersXX\FilamentGridstackDashboard\GridstackDashboardPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
GridstackDashboardPlugin::make()
])
}
You can configure the number of columns of the grid. Default is 12.
use InvadersXX\FilamentGridstackDashboard\GridstackDashboardPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
GridstackDashboardPlugin::make()
->columns(3),
])
}
You can configure the number of rows of the grid. Default is 0 (no constraint).
use InvadersXX\FilamentGridstackDashboard\GridstackDashboardPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
GridstackDashboardPlugin::make()
->rows(3),
])
}
You can configure the settings path (string in dotted format where to store in the settings) By default the path is 'dashboard.layout'
use InvadersXX\FilamentGridstackDashboard\GridstackDashboardPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
GridstackDashboardPlugin::make()
->settingsPath('dashboard.settings'),
])
}
You can enable/disable floating widgets (default: true).
use InvadersXX\FilamentGridstackDashboard\GridstackDashboardPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
GridstackDashboardPlugin::make()
->float(false),
])
}
You can enable/disable dragging widgets (default: false).
use InvadersXX\FilamentGridstackDashboard\GridstackDashboardPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
GridstackDashboardPlugin::make()
->disableDrag(true),
])
}
You can enable/disable resizing widgets (default: false).
use InvadersXX\FilamentGridstackDashboard\GridstackDashboardPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
GridstackDashboardPlugin::make()
->disableResize(true),
])
}
You can specify resizing handles position of widgets. It can be any combination of n,ne,e,se,s,sw,w,nw or all ( default: 'se').
use InvadersXX\FilamentGridstackDashboard\GridstackDashboardPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
GridstackDashboardPlugin::make()
->resizable('all'),
])
}
You can configure the navigationIcon, the navigationGroup, the navigationLabel, the navigationSort, canAccess and shouldRegisterNavigation
use InvadersXX\FilamentGridstackDashboard\GridstackDashboardPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
GridstackDashboardPlugin::make()
->navigationIcon('heroicon-o-chart-bar')
->navigationGroup('Admin')
->shouldRegisterNavigation(false)
->canAccess(fn() => auth()->id()===1)
->navigationLabel('Dashboard')
->navigationSort(1),
])
}
You can configure a default grid using defaultGrid() function. This function has an array as parameter. This array should have the following format:
[
'widget' => AccountWidget::class, // Widget class
'x' => 0, // starting column on the grid
'y' => 0, // row on the grid
'w' => 12, // number of columns on the grid
]
FYI, a 12 columns grid, x goes from 0 to 11
use InvadersXX\FilamentGridstackDashboard\GridstackDashboardPlugin;
use Filament\Widgets\AccountWidget;
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
GridstackDashboardPlugin::make()
->defaultGrid([
[
'widget' => AccountWidget::class,
'x' => 0,
'y' => 0,
'w' => 12,
],
]),
])
}
#Testing
composer test
#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.
The author
From the same author
Featured Plugins
A selection of plugins curated by the Filament team
Custom Dashboards
Let your users build and share their own dashboards with a drag-and-drop interface. Define your data sources in PHP and let them do the rest.
Filament
Advanced Tables (formerly Filter Sets)
Supercharge your tables with powerful features like user-customizable views, quick filters, multi-column sorting, advanced table searching, convenient view management, and more. Compatible with Resource Panel Tables, Relation Managers, Table Widgets, and Table Builder!
Kenneth Sese
Custom Fields
Eliminate custom field migrations forever. Let your users create and manage form fields directly in Filament admin panels with 20+ built-in field types, validation, and zero database changes.
Relaticle