1

As per filament documentation created a new file at app/Filament/Pages/Dashboard.php and also remove the original Dashboard class from filament.php

Dashboard.php File Code: (https://i.stack.imgur.com/39INc.png)

filament.php File Code:

'pages' => [
        'namespace' => 'App\\Filament\\Pages',
        'path' => app_path('Filament/Pages'),
        'register' => [],
    ],

After following these steps, I am facing these issues getting the Dashboard option multiple times in the sidebar.

(https://i.stack.imgur.com/PVf36.png)

1 Answers1

3

You can customize your Filament default Dashboard.php as follows... Create a custom page using

php artisan make:filament-page Dashbaord

  • it will generate a view file and a Dashboard class.
  • to add a default Widget in the dashboard widgets
<?php

namespace App\Filament\Pages;

use App\Filament\Widgets;
use Filament\Facades\Filament;
use Filament\Pages\Dashboard as BasePage;

class Dashboard extends BasePage
{
    protected function getWidgets(): array
    {
        // return default widgets
        return Filament::getWidgets();
    }
}

Now, if you want to add addition details then you can constomize page as per your requirement. https://filamentphp.com/tricks/how-to-customize-dashboard-page

Mitesh Rathod
  • 879
  • 5
  • 18