PHP code example of invaders-xx / filament-gridstack-dashboard

1. Go to this page and download the library: Download invaders-xx/filament-gridstack-dashboard library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

invaders-xx / filament-gridstack-dashboard example snippets


return [
];

use InvadersXX\FilamentGridstackDashboard\GridstackDashboardPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            GridstackDashboardPlugin::make()
        ])
}

use InvadersXX\FilamentGridstackDashboard\GridstackDashboardPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            GridstackDashboardPlugin::make()
                ->columns(3),
        ])
}

use InvadersXX\FilamentGridstackDashboard\GridstackDashboardPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            GridstackDashboardPlugin::make()
                ->rows(3),
        ])
}

use InvadersXX\FilamentGridstackDashboard\GridstackDashboardPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            GridstackDashboardPlugin::make()
                ->settingsPath('dashboard.settings'),
        ])
}

use InvadersXX\FilamentGridstackDashboard\GridstackDashboardPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            GridstackDashboardPlugin::make()
                ->float(false),
        ])
}

use InvadersXX\FilamentGridstackDashboard\GridstackDashboardPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            GridstackDashboardPlugin::make()
                ->disableDrag(true),
        ])
}

use InvadersXX\FilamentGridstackDashboard\GridstackDashboardPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            GridstackDashboardPlugin::make()
                ->disableResize(true),
        ])
}

use InvadersXX\FilamentGridstackDashboard\GridstackDashboardPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            GridstackDashboardPlugin::make()
                ->resizable('all'),
        ])
}

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),
        ])
}

[
    '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
]

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,
                    ],
                ]),
        ])
}
bash
php artisan filament:assets
bash
php artisan vendor:publish --tag="filament-gridstack-dashboard-config"
bash
php artisan vendor:publish --tag="filament-gridstack-dashboard-views"