Skip to main content
The make:dash command generates a fully functional admin dashboard controller with a customizable name.

Syntax

string
Optional name prefix for the dashboard (defaults to “Admin”)

Basic Usage

Create an admin dashboard with default name:
Output:

Custom Dashboard Name

Create a dashboard with a custom name:
Output:
The command automatically appends “DashboardController” to your chosen name, so you only need to specify the prefix.

Generated Controller

The command creates a controller with an admin panel integration:
App/Controllers/AdminDashboardController.php

Dashboard Features

AdminPanel Class

The generated controller uses Lyger’s AdminPanel class:

Customizable Title

Set a custom dashboard title:

Common Dashboard Types

Admin Dashboard (Default)

App/Controllers/AdminDashboardController.php

Analytics Dashboard

App/Controllers/AnalyticsDashboardController.php

Customer Dashboard

App/Controllers/CustomerDashboardController.php

Customizing Dashboards

Add Widgets

Extend the controller to add custom widgets:

Add Charts

Include data visualization:

Add Tables

Display data tables:

Setting Up Routes

After creating a dashboard, register the route:
routes/web.php
For multiple dashboards:
routes/web.php

Protecting Dashboards

Add authentication middleware to protect dashboard routes:
routes/web.php
Or check authentication within the controller:

Error Handling

Missing Name (Uses Default)

Creates AdminDashboardController with “Admin” as default name.

Duplicate Dashboard

Output:

Complete Example

Source Code

The dashboard generation logic:
rawr (lines 356-395)

Dashboard Layout Ideas

Multi-Column Layout

Tabbed Interface

Responsive Cards

Advanced Features

Real-time Updates

Add WebSocket support for live data:

Export Functionality

Add data export capabilities:

Custom Styling

Override default AdminPanel styles:

Next Steps

AdminPanel Class

Learn about AdminPanel features

Middleware

Protect dashboard routes

Make Controller

Create additional controllers

Routing

Configure dashboard routes