Press K to search
Back to Home

Tyro Dashboard Documentation

Everything you need to build a beautiful admin dashboard for managing Tyro roles, privileges, users, and package settings in Laravel 12.

Introduction

Tyro Dashboard is a beautiful, modern admin dashboard package for Laravel 12 that provides a complete interface for managing users, roles, privileges, and package settings. It seamlessly integrates with the Tyro RBAC package and optionally with Tyro Login.

With Tyro Dashboard, you get a professional-grade admin panel with dark/light theme support, responsive design, and intuitive user interfaces – all without writing any frontend code.

Quick Setup: Install via Composer and run the installer – your admin dashboard will be ready at /dashboard in under 5 minutes.
Tyro Ecosystem: Tyro Dashboard works best with Tyro (RBAC) and Tyro Login (Authentication). Together, they provide a complete user management solution for Laravel 12.

Features

Tyro Dashboard comes packed with features to help you manage your application effectively:

Beautiful UI

Modern, responsive design that matches Tyro Login aesthetics with attention to every detail.

User Management

Create, edit, suspend, and manage users with an intuitive interface and role assignment.

Role Management

Full CRUD operations for roles with privilege assignment and protection for critical roles.

Privilege Management

Manage privileges and assign them to roles for fine-grained access control.

Settings Management

Configure Tyro and Tyro Login packages from a beautiful UI interface.

Profile Management

Users can update their own profile information with self-service account management.

Dark Mode

Built-in dark/light theme support that respects user preferences and system settings.

Responsive Design

Works perfectly on all device sizes from mobile phones to large desktop monitors.

Role-Based Access

Admin-only features are protected by configurable role-based access control.

Resource Configuration

Tyro Dashboard provides flexible configuration options for your resources, allowing you to customize search behavior, field types, and access control.

Search Settings

You can configure which fields are searchable in the resource listing. This can be done globally for the resource or on a per-field basis.

// Option 1: Global search configuration
'search' => ['name', 'email'],

// Option 2: Per-field configuration
'fields' => [
    'name' => [
        'type' => 'text',
        'searchable' => true
    ],
    // ...
]

Field Types

Tyro supports various field types to handle different kinds of data. Specify the type in your field configuration.

Type Description Options
text Standard text input label, required, placeholder
number Numeric input min, max, step, prefix
select Dropdown selection options (array)
toggle Boolean switch label
richtext Rich text editor (Quill.js) height
markdown Markdown editor with live preview (EasyMDE) label, hide_in_index
textarea Multi-line text area rows
password Password input required
'status' => [
    'type' => 'select',
    'options' => ['active', 'inactive'],
    'label' => 'Account Status',
    'required' => true
],
'is_admin' => [
    'type' => 'toggle',
    'label' => 'Administrator Access'
]

Rich Text Editor

Enable a rich text editor (Quill.js) for any text field by setting the type to richtext. This provides a user-friendly interface for editing formatted content.

'fields' => [
    'bio' => [
        'type' => 'richtext',
        'label' => 'Biography',
        'required' => true
    ]
]

Markdown Editor

Enable a markdown editor with live preview (EasyMDE) for any text field by setting the type to markdown. Features a single-pane editor with built-in preview toggle.

'fields' => [
    'content' => [
        'type' => 'markdown',
        'label' => 'Post Content',
        'hide_in_index' => true,  // Hide from table view
        'placeholder' => 'Write your content in markdown...'
    ]
]

File Upload with Image Preview

File upload fields can display image previews in the edit form. The preview automatically detects image file types and displays them at 200px width with auto height.

'fields' => [
    'profile_picture' => [
        'type' => 'file',
        'label' => 'Profile Picture',
        'rules' => 'nullable|image|max:2048',  // 2MB max
        'display_image' => true,  // Show image preview
        'display_image_position' => 'top',  // 'top' or 'bottom'
    ],
    'product_image' => [
        'type' => 'file',
        'label' => 'Product Image',
        'rules' => 'nullable|image|max:5120',
        'display_image' => true,
        'display_image_position' => 'bottom',  // Display below file input
    ],
    'document' => [
        'type' => 'file',
        'label' => 'PDF Document',
        'rules' => 'nullable|mimes:pdf|max:10240',
        // No display_image for non-image files
    ],
]
Note: Image preview only works for image files (.jpg, .jpeg, .png, .gif, .webp, .svg) and only appears in edit forms where a file already exists.

Field Visibility & Control Options

Control where and how fields are displayed using visibility and behavior options:

Visibility Options

'fields' => [
    'description' => [
        'type' => 'textarea',
        'hide_in_index' => true,  // Hide from list view table
    ],
    'internal_notes' => [
        'type' => 'textarea',
        'hide_in_single_view' => true,  // Hide from detail view
    ],
    'slug' => [
        'type' => 'text',
        'hide_in_create' => true,  // Hide in create form (auto-generated)
    ],
    'created_by' => [
        'type' => 'select',
        'relationship' => 'creator',
        'hide_in_edit' => true,  // Hide in edit form (immutable)
    ],
    'password' => [
        'type' => 'password',
        'hide_in_index' => true,
        'hide_in_single_view' => true,  // Hide in views
    ]
]

Field Behavior Options

Control field behavior with default values, placeholders, readonly state, and custom attributes:

'fields' => [
    'status' => [
        'type' => 'text',
        'default' => 'draft',  // Default value in create form
        'placeholder' => 'Enter status',  // Placeholder text
    ],
    'total_amount' => [
        'type' => 'text',
        'readonly' => true,  // Field is rendered but cannot be edited
        'label' => 'Total Amount (Calculated)',
    ],
    'bio' => [
        'type' => 'textarea',
        'placeholder' => 'Tell us about yourself...',
        'attributes' => [  // Custom HTML attributes
            'rows' => '10',
            'cols' => '50',
            'class' => 'custom-textarea',
            'data-counter' => 'true',
            'maxlength' => '500'
        ]
    ],
]

Complete Field Options Reference

All available field configuration options at a glance:

Option Type Description
type string Required. Field type (text, email, password, textarea, select, file, etc.)
label string Display label for the field. Auto-generated from field name if not provided.
rules string Laravel validation rules (e.g., 'required|email|max:255')
help_text string Help text displayed below the field to guide users
hide_in_index boolean New! Hide field from list/table view. Default: false
hide_in_single_view boolean New! Hide field from detail/show view. Default: false
hide_in_create boolean New! Hide field in create form (useful for auto-generated fields). Default: false
hide_in_edit boolean New! Hide field in edit form (useful for immutable fields). Default: false
default mixed New! Default value for the field in create form. Default: empty
placeholder string New! Placeholder text for input fields. Default: empty
readonly boolean New! Make field read-only (rendered with value but cannot be edited). Default: false
attributes array New! Custom HTML attributes as key-value pairs (e.g., ['rows' => '10', 'maxlength' => '500'])
searchable boolean Make field searchable in list view. Default: false
sortable boolean Make field sortable in list view. Default: false
relationship string Name of the Eloquent relationship method (for select/multiselect fields)
option_label string Attribute to display for relationship options. Default: 'name'
options array Array of options for select/radio/checkbox fields (e.g., ['active', 'inactive'])
multiple boolean Enable multiple selection for select fields (BelongsToMany). Default: false
display_image boolean New! (File fields only) Display uploaded image preview. Default: false
display_image_position string New! (File fields only) Position of image preview: 'top' or 'bottom'. Default: 'top'
Pro Tip: New field options (highlighted in blue) give you unprecedented control over field behavior and visibility, making your forms cleaner and more user-friendly.

Readonly Resources

You can mark a resource as readonly for specific roles. This prevents users with those roles from creating, editing, or deleting records, while still allowing them to view the resource.

'readonly' => true, // Make readonly for everyone

// Or restrict for specific roles
'readonly' => ['editor', 'viewer'],

Error Visibility

Control the visibility of error messages in the UI. You can toggle the global error summary at the top of the page and the individual field error messages.

These settings can be configured in config/tyro-dashboard.php or via environment variables.

# .env file

# Show/Hide the top error summary (default: true)
TYRO_SHOW_GLOBAL_ERRORS=true

# Show/Hide errors under individual fields (default: true)
TYRO_SHOW_FIELD_ERRORS=true

Screenshots

Here are some screenshots of Tyro Dashboard in action:

Dashboard Landing Light Mode

Dashboard Landing Light Mode

Dashboard Landing Dark Mode

Dashboard Landing Dark Mode

Profile Management Light Mode

Profile Management Light Mode

Profile Management Dark Mode

Profile Management Dark Mode

User Management Light Mode

User Management Light Mode

User Management Dark Mode

User Management Dark Mode

Role Management Light Mode

Role Management Light Mode

Role Management Dark Mode

Role Management Dark Mode

Create Role Light Mode

Create Role Light Mode

Create Role Dark Mode

Create Role Dark Mode

Role Detail Light Mode

Role Detail Light Mode

Role Detail Dark Mode

Role Detail Dark Mode

Edit User Light Mode

Edit User Light Mode

Edit User Dark Mode

Edit User Dark Mode

Privilege Management Light Mode

Privilege Management Light Mode

Privilege Management Dark Mode

Privilege Management Dark Mode

Create Privilege Light Mode

Create Privilege Light Mode

Create Privilege Dark Mode

Create Privilege Dark Mode

Privilege Detail Light Mode

Privilege Detail Light Mode

Privilege Detail Dark Mode

Privilege Detail Dark Mode

Edit Privilege Light Mode

Edit Privilege Light Mode

Edit Privilege Dark Mode

Edit Privilege Dark Mode

Requirements

  • PHP: 8.2 or higher
  • Laravel: 12.x
  • Tyro Package: hasinhayder/tyro ^1.0 (required)
  • Tyro Login: hasinhayder/tyro-login ^1.0 (optional but recommended)
  • Database: Any database supported by Laravel

Installation

Install Tyro Dashboard in just two simple steps:

Step 1: Install via Composer

Terminal
composer require hasinhayder/tyro-dashboard

Step 2: Run the Interactive Installer

Terminal
php artisan tyro-dashboard:install

The installer will:

  • Check dependencies (Tyro package)
  • Publish the configuration file
  • Optionally publish views for customization
  • Help you configure admin roles and branding
Done! Your admin dashboard is now available at /dashboard. Login with an admin account to access all features.

Manual Installation

If you prefer manual setup:

Terminal
# Publish configuration
php artisan vendor:publish --tag=tyro-dashboard-config

# Optionally publish views
php artisan vendor:publish --tag=tyro-dashboard-views

Route Settings

Configure how Tyro Dashboard routes are registered:

config/tyro-dashboard.php
'routes' => [
    // URL prefix for all dashboard routes
    'prefix' => env('TYRO_DASHBOARD_PREFIX', 'dashboard'),

    // Middleware applied to all dashboard routes
    'middleware' => ['web', 'auth'],

    // Route name prefix
    'name_prefix' => 'tyro-dashboard.',
],

Environment Variables

.env
# Change dashboard URL from /dashboard to /admin
TYRO_DASHBOARD_PREFIX=admin

Admin Roles

Configure which roles have full admin access to the dashboard:

config/tyro-dashboard.php
// Users with these roles have full admin access
'admin_roles' => ['admin', 'super-admin'],

Users with these roles can:

  • Manage all users (create, edit, suspend, delete)
  • Manage all roles and privileges
  • Access and modify package settings
  • View the full admin dashboard

Users without admin roles can only:

  • Access the dashboard home page
  • Manage their own profile

Pagination Settings

Configure how many items appear per page in lists:

config/tyro-dashboard.php
'pagination' => [
    'users' => 15,      // Users per page
    'roles' => 15,      // Roles per page
    'privileges' => 15, // Privileges per page
],

Branding

Customize the dashboard with your brand identity:

config/tyro-dashboard.php
'branding' => [
    // Application name shown in dashboard
    'app_name' => env('TYRO_DASHBOARD_APP_NAME', env('APP_NAME', 'Laravel')),

    // URL to your logo (null for text-based logo)
    'logo' => env('TYRO_DASHBOARD_LOGO', null),
],

Environment Variables

.env
TYRO_DASHBOARD_APP_NAME="My Application"
TYRO_DASHBOARD_LOGO="/images/logo.svg"

User Management

The User Management section allows administrators to:

  • View Users: Browse all users with search and pagination
  • Create Users: Add new users with name, email, and role assignment
  • Edit Users: Update user information and change roles
  • Suspend Users: Temporarily disable user accounts
  • Delete Users: Remove users from the system
Note: User management is only available to users with admin roles configured in admin_roles.
Pro Tip: You can quickly create an admin user via the command line using php artisan tyro-dashboard:createsuperuser.

Routes

Route Description
/dashboard/users List all users
/dashboard/users/create Create new user form
/dashboard/users/{id}/edit Edit user form

Role Management

Manage roles for your application's access control:

  • View Roles: Browse all roles with their assigned privileges
  • Create Roles: Add new roles with name, slug, and description
  • Edit Roles: Update role information and assign/remove privileges
  • View Role Details: See all privileges assigned to a role
  • Delete Roles: Remove roles (protected roles cannot be deleted)
Protected Roles: Critical roles like admin, super-admin, and user cannot be deleted through the dashboard.

Routes

Route Description
/dashboard/roles List all roles
/dashboard/roles/create Create new role form
/dashboard/roles/{id} View role details

Privilege Management

Manage privileges for fine-grained access control:

  • View Privileges: Browse all privileges in the system
  • Create Privileges: Add new privileges with name, slug, and description
  • Edit Privileges: Update privilege information
  • Delete Privileges: Remove privileges from the system

Routes

Route Description
/dashboard/privileges List all privileges
/dashboard/privileges/create Create new privilege form

Settings Management

Configure Tyro packages through a beautiful UI:

Tyro Settings

Configure the main Tyro RBAC package settings:

  • Default role assignment
  • Cache settings
  • Permission checking behavior

Tyro Login Settings

Configure Tyro Login package settings (if installed):

  • Layout options
  • Branding settings
  • Security features (lockout, captcha, OTP)
  • Email verification settings
  • Social login configuration
Note: The Tyro Login settings page only appears if the hasinhayder/tyro-login package is installed.

Routes

Route Description
/dashboard/settings/tyro Tyro package settings
/dashboard/settings/tyro-login Tyro Login settings

Profile Management

All authenticated users can manage their own profile:

  • Update Name: Change display name
  • Update Email: Change email address
  • Change Password: Update account password
  • Profile Picture: Upload or change avatar

Route

Route Description Access
/dashboard/profile User profile settings All authenticated users

Page Creation

Tyro Dashboard includes powerful artisan commands to scaffold complete dashboard pages in seconds. These commands automatically handle everything from view creation to route registration and sidebar navigation.

Quick Pages: Create fully functional dashboard pages with a single command. Perfect for building analytics dashboards, reports, settings pages, or any custom functionality.

Available Commands

Three specialized commands let you create pages with different access levels:

User Pages

Create pages for regular authenticated users. Perfect for dashboards, reports, and user-specific features.

Admin Pages

Create admin-only pages with role-based access control. Ideal for system settings, advanced configurations, and management tools.

Common Pages

Create pages accessible to both users and admins. Great for help centers, documentation, and shared resources.

Create User Page

The create-user-page command generates pages for regular authenticated users. These pages extend the user layout and appear in the user sidebar.

bash
# Interactive mode - prompts for page name
php artisan tyro-dashboard:create-user-page

# Direct mode - provide page name as argument
php artisan tyro-dashboard:create-user-page "analytics"

# With multiple words (automatically slugified)
php artisan tyro-dashboard:create-user-page "Sales Reports"
# Creates: /dashboard/sales-reports

# Overwrite existing files
php artisan tyro-dashboard:create-user-page "analytics" --force

What Gets Created

View File: resources/views/dashboard/{page-name}.blade.php
Layout: tyro-dashboard::layouts.user
Route: /dashboard/{page-name}
Middleware: auth
Sidebar: User sidebar → Menu section

Generated Route

Route::view('dashboard/{page-name}', 'dashboard.{page-name}')
    ->middleware(['auth'])
    ->name('dashboard.{page-name}');

Create Admin Page

The create-admin-page command generates pages exclusively for administrators. These pages are protected with the tyro-dashboard.admin middleware and appear in the admin sidebar.

bash
# Interactive mode
php artisan tyro-dashboard:create-admin-page

# Direct mode
php artisan tyro-dashboard:create-admin-page "system-logs"

# With multiple words
php artisan tyro-dashboard:create-admin-page "Advanced Settings"
# Creates: /dashboard/advanced-settings

# Overwrite existing files
php artisan tyro-dashboard:create-admin-page "system-logs" --force

What Gets Created

View File: resources/views/dashboard/{page-name}.blade.php
Layout: tyro-dashboard::layouts.admin
Route: /dashboard/{page-name}
Middleware: auth, tyro-dashboard.admin
Sidebar: Admin sidebar → Administration section

Generated Route

Route::view('dashboard/{page-name}', 'dashboard.{page-name}')
    ->middleware(['auth', 'tyro-dashboard.admin'])
    ->name('dashboard.{page-name}');

Create Common Page

The create-common-page command creates pages accessible to both regular users and administrators. These pages appear in both the user and admin sidebars.

bash
# Interactive mode
php artisan tyro-dashboard:create-common-page

# Direct mode
php artisan tyro-dashboard:create-common-page "help-center"

# With multiple words
php artisan tyro-dashboard:create-common-page "Support Documentation"
# Creates: /dashboard/support-documentation

# Overwrite existing files
php artisan tyro-dashboard:create-common-page "help-center" --force

What Gets Created

View File: resources/views/dashboard/{page-name}.blade.php
Layout: tyro-dashboard::layouts.app
Route: /dashboard/{page-name}
Middleware: auth
Sidebar: Both user and admin sidebars → Menu section

Generated Route

Route::view('dashboard/{page-name}', 'dashboard.{page-name}')
    ->middleware(['auth'])
    ->name('dashboard.{page-name}');

Generated Page Structure

All generated pages follow a consistent, clean structure that's ready to customize:

Generated Page File Locations

Understanding where files are created and modified helps you customize your pages:

text Project Structure
your-laravel-app/
├── resources/
│   └── views/
│       ├── dashboard/
│       │   └── page-name.blade.php          ← New page view created here
│       └── vendor/
│           └── tyro-dashboard/
│               └── partials/
│                   ├── user-sidebar.blade.php  ← Link added here (user/common)
│                   └── admin-sidebar.blade.php ← Link added here (admin/common)
└── routes/
    └── web.php                                 ← Route registered here

Automatic Features

Every generated page includes these features out of the box:

Breadcrumb Navigation

Automatic breadcrumb with link back to dashboard

Sidebar Integration

Automatically added to appropriate sidebar with icon

Route Registration

Named route added to web.php with proper middleware

User Context

$user variable automatically available in all views

Dark Mode Ready

Inherits theme support from dashboard layouts

Responsive Design

Mobile-friendly layout with responsive components

Smart View Publishing: If dashboard views haven't been published yet, the commands automatically publish the necessary views before creating your page.

Use Cases

Here are some practical examples of when to use each command:

User Pages

  • Personal analytics dashboard
  • Sales reports and metrics
  • Order history and tracking
  • User preferences and settings
  • Project management boards

Admin Pages

  • System logs and monitoring
  • Application configuration
  • Advanced security settings
  • Email template management
  • API key management
  • Database backup and restore

Common Pages

  • Help center and documentation
  • FAQ and knowledge base
  • Announcements and news
  • Company information
  • Contact and support forms

Page Removal Commands

Safely remove dashboard pages that were created with the page creation commands. These commands will delete the view file, remove the route from web.php, and remove the sidebar link.

⚠️ Warning: These commands will permanently delete files. You'll be asked to confirm before deletion.

Remove Admin Page

tyro-dashboard:remove-admin-page

Remove User Page

tyro-dashboard:remove-user-page

Remove Common Page

tyro-dashboard:remove-common-page

Remove User Page

Remove a user-facing dashboard page that was created with create-user-page.

# Interactive mode - asks for page name
php artisan tyro-dashboard:remove-user-page

# Direct mode - provide page name as argument
php artisan tyro-dashboard:remove-user-page "my-reports"

What Gets Removed

View File resources/views/dashboard/{page-name}.blade.php
Route Removed from routes/web.php
Sidebar Link Removed from user-sidebar.blade.php

Remove Admin Page

Remove an admin-only dashboard page that was created with create-admin-page.

# Interactive mode
php artisan tyro-dashboard:remove-admin-page

# Direct mode
php artisan tyro-dashboard:remove-admin-page "system-settings"

What Gets Removed

View File resources/views/dashboard/{page-name}.blade.php
Route Removed from routes/web.php (with admin middleware)
Sidebar Link Removed from admin-sidebar.blade.php

Remove Common Page

Remove a common dashboard page that was created with create-common-page. This removes the page from both user and admin sidebars.

# Interactive mode
php artisan tyro-dashboard:remove-common-page

# Direct mode
php artisan tyro-dashboard:remove-common-page "help-center"

What Gets Removed

View File resources/views/dashboard/{page-name}.blade.php
Route Removed from routes/web.php
Sidebar Links Removed from both user-sidebar.blade.php and admin-sidebar.blade.php
💡 Note: If the page is not found or files have already been removed, the command will display a "Page not found" message without performing any deletion.

Page Removal

Remove dashboard pages that were created with the page creation commands. These commands safely delete view files, routes, and sidebar links.

tyro-dashboard:remove-user-page

Remove a user-facing dashboard page.

php artisan tyro-dashboard:remove-user-page

# Direct mode
php artisan tyro-dashboard:remove-user-page "my-reports"

tyro-dashboard:remove-admin-page

Remove an admin-only dashboard page.

php artisan tyro-dashboard:remove-admin-page

# Direct mode
php artisan tyro-dashboard:remove-admin-page "system-settings"

tyro-dashboard:remove-common-page

Remove a common dashboard page (removes from both sidebars).

php artisan tyro-dashboard:remove-common-page

# Direct mode
php artisan tyro-dashboard:remove-common-page "help-center"

What removal commands do:

  • Delete the Blade view file from resources/views/dashboard/
  • Remove the route from routes/web.php
  • Remove the sidebar link(s) from the appropriate sidebar file(s)
  • Show a warning and ask for confirmation before deletion
  • Display "Page not found" message if the page doesn't exist
⚠️ Warning: These commands permanently delete files. Always confirm you're removing the correct page before proceeding.

CRUD Workflow

Creating a new resource in Tyro Dashboard is a streamlined process. Follow these steps to set up a complete CRUD interface in minutes.

1. Create Migration & Model

Start by creating your standard Laravel model and migration.

php artisan make:model Product -m

2. Create Resource Controller

Create a controller that extends TyroResourceController. This is where you define your resource configuration.

namespace App\Http\Controllers\Admin;

use Tyro\Dashboard\Controllers\TyroResourceController;
use App\Models\Product;

class ProductController extends TyroResourceController
{
    // The Eloquent model associated with this resource
    protected $model = Product::class;
    
    // The page title
    protected $title = 'Products';

    // Define the fields for the resource
    public function fields()
    {
        return [
            'name' => [
                'type' => 'text',
                'label' => 'Product Name',
                'required' => true,
                'searchable' => true
            ],
            'price' => [
                'type' => 'number',
                'prefix' => '$',
                'required' => true
            ],
            'status' => [
                'type' => 'select',
                'options' => ['active', 'draft', 'archived']
            ],
            'description' => [
                'type' => 'richtext'
            ]
        ];
    }
}

3. Add Route

Register your resource route in routes/web.php. Tyro provides a helper macro tyroResource that registers all necessary routes (index, create, store, edit, update, destroy).

use App\Http\Controllers\Admin\ProductController;

Route::middleware(['auth', 'tyro'])->prefix('dashboard')->group(function () {
    Route::tyroResource('products', ProductController::class);
});

Search Configuration

By default, Tyro searches in columns defined in your fields() method where 'searchable' => true. You can customize the search behavior by overriding the search() method.

public function search()
{
    return [
        'columns' => ['name', 'email', 'description'], // Columns to search
        'placeholder' => 'Search users...' // Placeholder text for search input
    ];
}

Field Types

Tyro supports a variety of field types to handle different data formats. Here is a complete reference:

Type Description Options
text Standard text input required, label, placeholder
number Numeric input prefix, suffix, step, min, max
email Email input with validation required, label
password Password input (masked) required, label
textarea Multi-line text area rows, placeholder
richtext WYSIWYG editor (Trix) height, toolbar options
select Dropdown menu options (array or closure)
toggle Boolean switch active_label, inactive_label
date Date picker format
image Image uploader disk, path, preview_width

Rich Text Editor

To enable a rich text editor for a field, simply set the type to richtext. Tyro uses Trix editor by default.

'bio' => [
    'type' => 'richtext',
    'label' => 'Biography',
]

Readonly Resources

If you want to disable creating, editing, or deleting records for a specific resource, you can set the $readonly property.

protected $readonly = true;

This will remove the "Create" button and the "Edit/Delete" actions from the index view.

Error Visibility

You can control whether validation errors are shown globally or inline. Override the $showErrors property.

protected $showErrors = true; // Default is true

Publishing Assets

Customize Tyro Dashboard by publishing assets:

Publish Configuration

Terminal
php artisan vendor:publish --tag=tyro-dashboard-config

Publish Views

Terminal
php artisan vendor:publish --tag=tyro-dashboard-views

Views will be published to resources/views/vendor/tyro-dashboard/.

Theme Customization (shadcn Variables)

Tyro Dashboard uses shadcn/ui CSS variables for theming, making it easy to customize colors and integrate with shadcn-based projects. The theme system is fully compatible with the tweakcn.com visual theme editor.

Publishing Theme Files

Publish the theme variables to customize the look and feel of your dashboard:

Terminal
# Publish only theme variables (recommended for color customization)
php artisan tyro-dashboard:publish-style --theme-only

# Or publish complete styles (theme + component styles)
php artisan tyro-dashboard:publish-style

Theme files will be published to resources/views/vendor/tyro-dashboard/partials/.

Visual Theme Editing with tweakcn

The easiest way to customize your theme is using tweakcn.com:

  1. Visit tweakcn.com
  2. Use the visual editor to create your perfect color palette
  3. Copy the generated CSS variables
  4. Publish your theme: php artisan tyro-dashboard:publish-style --theme-only
  5. Paste the variables into resources/views/vendor/tyro-dashboard/partials/shadcn-theme.blade.php
Pro Tip: Use tweakcn.com's visual editor to preview your color changes in real-time before applying them to your project.

Theme File Structure

After publishing, your theme structure will be:

File Structure
resources/views/vendor/tyro-dashboard/partials/
├── shadcn-theme.blade.php  # Theme variables (edit this!)
└── styles.blade.php        # Component styles (includes theme)

The shadcn-theme.blade.php file contains only CSS variables, making it safe to edit without breaking component styles.

Available CSS Variables

Tyro Dashboard uses standard shadcn CSS variables in oklch color format for both light and dark modes:

Variable Description
--radius Default border radius
--background Page background color
--foreground Default text color
--primary Primary buttons and links
--primary-foreground Primary text color
--secondary Secondary elements
--secondary-foreground Secondary text color
--muted Muted backgrounds
--muted-foreground Muted text color
--accent Accent backgrounds
--accent-foreground Accent text color
--destructive Error and danger states
--border Border colors
--input Input field borders
--ring Focus ring colors
--card Card background colors
--card-foreground Card text color
--popover Popover background colors
--popover-foreground Popover text color
--chart-1 Chart color 1
--chart-2 Chart color 2
--chart-3 Chart color 3
--chart-4 Chart color 4
--chart-5 Chart color 5
--sidebar Sidebar background
--sidebar-foreground Sidebar text color
--sidebar-primary Sidebar primary color
--sidebar-primary-foreground Sidebar primary text
--sidebar-accent Sidebar accent color
--sidebar-accent-foreground Sidebar accent text
--sidebar-border Sidebar border color
--sidebar-ring Sidebar focus ring
--success Success states
--success-foreground Success text color
--warning Warning states
--warning-foreground Warning text color
--info Info states
--info-foreground Info text color
--card-shadow Default card shadow
--card-shadow-hover Card hover shadow

Manual Theme Editing

If you prefer to edit the theme manually, open resources/views/vendor/tyro-dashboard/partials/shadcn-theme.blade.php and modify the CSS variables:

resources/views/vendor/tyro-dashboard/partials/shadcn-theme.blade.php
<style>
    :root {
        /* Base radius for components */
        --radius: 0.625rem;

        /* Light mode colors */
        --background: oklch(1 0 0);
        --foreground: oklch(0.145 0 0);
        --card: oklch(1 0 0);
        --card-foreground: oklch(0.145 0 0);
        --popover: oklch(1 0 0);
        --popover-foreground: oklch(0.145 0 0);
        --primary: oklch(0.205 0 0);
        --primary-foreground: oklch(0.985 0 0);
        --secondary: oklch(0.97 0 0);
        --secondary-foreground: oklch(0.205 0 0);
        --muted: oklch(0.97 0 0);
        --muted-foreground: oklch(0.556 0 0);
        --accent: oklch(0.97 0 0);
        --accent-foreground: oklch(0.205 0 0);
        --destructive: oklch(0.577 0.245 27.325);
        --border: oklch(0.922 0 0);
        --input: oklch(0.922 0 0);
        --ring: oklch(0.708 0 0);

        /* Chart colors */
        --chart-1: oklch(0.646 0.222 41.116);
        --chart-2: oklch(0.6 0.118 184.704);
        --chart-3: oklch(0.398 0.07 227.392);
        --chart-4: oklch(0.828 0.189 84.429);
        --chart-5: oklch(0.769 0.188 70.08);

        /* Sidebar colors */
        --sidebar: oklch(0.985 0 0);
        --sidebar-foreground: oklch(0.145 0 0);
        --sidebar-primary: oklch(0.205 0 0);
        --sidebar-primary-foreground: oklch(0.985 0 0);
        --sidebar-accent: oklch(0.97 0 0);
        --sidebar-accent-foreground: oklch(0.205 0 0);
        --sidebar-border: oklch(0.922 0 0);
        --sidebar-ring: oklch(0.708 0 0);

        /* Extended semantic colors */
        --success: oklch(0.627 0.194 149.214);
        --success-foreground: oklch(1 0 0);
        --warning: oklch(0.769 0.188 70.08);
        --warning-foreground: oklch(0.205 0 0);
        --info: oklch(0.623 0.214 259.815);
        --info-foreground: oklch(1 0 0);

        /* Card shadows */
        --card-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
        --card-shadow-hover: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    }

    /* Dark mode colors - using .dark class */
    .dark {
        --background: oklch(0.145 0 0);
        --foreground: oklch(0.985 0 0);
        --card: oklch(0.205 0 0);
        --card-foreground: oklch(0.985 0 0);
        --popover: oklch(0.205 0 0);
        --popover-foreground: oklch(0.985 0 0);
        --primary: oklch(0.922 0 0);
        --primary-foreground: oklch(0.205 0 0);
        --secondary: oklch(0.269 0 0);
        --secondary-foreground: oklch(0.985 0 0);
        --muted: oklch(0.269 0 0);
        --muted-foreground: oklch(0.708 0 0);
        --accent: oklch(0.269 0 0);
        --accent-foreground: oklch(0.985 0 0);
        --destructive: oklch(0.704 0.191 22.216);
        --border: oklch(1 0 0 / 10%);
        --input: oklch(1 0 0 / 15%);
        --ring: oklch(0.556 0 0);

        /* Chart colors (dark mode) */
        --chart-1: oklch(0.488 0.243 264.376);
        --chart-2: oklch(0.696 0.17 162.48);
        --chart-3: oklch(0.769 0.188 70.08);
        --chart-4: oklch(0.627 0.265 303.9);
        --chart-5: oklch(0.645 0.246 16.439);

        /* Sidebar colors (dark mode) */
        --sidebar: oklch(0.205 0 0);
        --sidebar-foreground: oklch(0.985 0 0);
        --sidebar-primary: oklch(0.488 0.243 264.376);
        --sidebar-primary-foreground: oklch(0.985 0 0);
        --sidebar-accent: oklch(0.269 0 0);
        --sidebar-accent-foreground: oklch(0.985 0 0);
        --sidebar-border: oklch(1 0 0 / 10%);
        --sidebar-ring: oklch(0.556 0 0);

        /* Extended semantic colors (dark mode) */
        --success: oklch(0.696 0.17 162.48);
        --success-foreground: oklch(0.145 0 0);
        --warning: oklch(0.769 0.188 70.08);
        --warning-foreground: oklch(0.145 0 0);
        --info: oklch(0.488 0.243 264.376);
        --info-foreground: oklch(0.985 0 0);

        /* Card shadows (dark mode) */
        --card-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.2);
        --card-shadow-hover: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.2);
    }
</style>
Shadcn Compatibility: These variables follow the exact shadcn/ui specification, ensuring compatibility with shadcn-based components and the tweakcn.com visual editor.

Environment Variables

Complete list of environment variables for Tyro Dashboard:

Variable Description Default
TYRO_DASHBOARD_PREFIX URL prefix for dashboard routes dashboard
TYRO_DASHBOARD_APP_NAME Application name shown in dashboard APP_NAME
TYRO_DASHBOARD_LOGO URL to custom logo null

Artisan Commands

Tyro Dashboard provides the following artisan commands:

Command Description
php artisan tyro-dashboard:install Interactive installation wizard
php artisan tyro-dashboard:version Display version information
php artisan tyro-dashboard:publish-style Publish styles and theme files
php artisan tyro-dashboard:publish-style --theme-only Publish only theme variables (recommended)
php artisan tyro-dashboard:createsuperuser Create a superuser with admin privileges interactively
php artisan tyro-dashboard:create-user-page Create a new user dashboard page with automatic sidebar linking
php artisan tyro-dashboard:create-admin-page Create a new admin dashboard page with automatic sidebar linking
php artisan tyro-dashboard:create-common-page Create a common page visible to both users and admins

Page Creation Commands

Tyro Dashboard includes powerful commands to generate complete dashboard pages in seconds. These commands automatically create views, register routes, and add sidebar navigation links.

Create User Page

Creates a new page for regular users, extending the user layout and adding it to the user sidebar.

# Interactive mode - prompts for page name
php artisan tyro-dashboard:create-user-page

# Direct mode - provide page name as argument
php artisan tyro-dashboard:create-user-page "my-reports"

# Overwrite existing files
php artisan tyro-dashboard:create-user-page "my-reports" --force

What this command does:

  • Creates a Blade view file at resources/views/dashboard/{page-name}.blade.php
  • Extends tyro-dashboard::layouts.user layout
  • Adds a route to routes/web.php with auth middleware
  • Automatically links the page in the user sidebar under "Menu" section
  • Includes proper breadcrumb navigation
  • Publishes user views if not already published

Generated route:

Route::view('dashboard/{page-name}', 'dashboard.{page-name}')
    ->middleware(['auth'])
    ->name('dashboard.{page-name}');

Create Admin Page

Creates a new page for administrators, extending the admin layout and adding it to the admin sidebar.

# Interactive mode
php artisan tyro-dashboard:create-admin-page

# Direct mode
php artisan tyro-dashboard:create-admin-page "system-settings"

# Overwrite existing files
php artisan tyro-dashboard:create-admin-page "system-settings" --force

What this command does:

  • Creates a Blade view file at resources/views/dashboard/{page-name}.blade.php
  • Extends tyro-dashboard::layouts.admin layout
  • Adds a route to routes/web.php with auth and tyro-dashboard.admin middleware
  • Automatically links the page in the admin sidebar under "Administration" section
  • Includes proper breadcrumb navigation
  • Publishes admin views if not already published

Generated route:

Route::view('dashboard/{page-name}', 'dashboard.{page-name}')
    ->middleware(['auth', 'tyro-dashboard.admin'])
    ->name('dashboard.{page-name}');

Create Common Page

Creates a page accessible to both regular users and administrators, extending the common app layout.

# Interactive mode
php artisan tyro-dashboard:create-common-page

# Direct mode
php artisan tyro-dashboard:create-common-page "help-center"

# Overwrite existing files
php artisan tyro-dashboard:create-common-page "help-center" --force

What this command does:

  • Creates a Blade view file at resources/views/dashboard/{page-name}.blade.php
  • Extends tyro-dashboard::layouts.app layout
  • Adds a route to routes/web.php with auth middleware
  • Automatically links the page in both user and admin sidebars under "Menu" section
  • Includes proper breadcrumb navigation
  • Publishes all dashboard views if not already published

Generated route:

Route::view('dashboard/{page-name}', 'dashboard.{page-name}')
    ->middleware(['auth'])
    ->name('dashboard.{page-name}');

Page Structure

All generated pages follow a consistent structure with proper sections and styling:

@extends('tyro-dashboard::layouts.user') {{-- or admin/app --}}

@section('title', 'Page Title')

@section('breadcrumb')
Dashboard
/
Page Title
@endsection

@section('content')


Page Title Content

This is a new dashboard page. Start building your content here.

@endsection

File Locations

When you create a page, the following files are created or modified:

your-laravel-app/
├── resources/
│   └── views/
│       ├── dashboard/
│       │   └── {page-name}.blade.php          ← New page view created here
│       └── vendor/
│           └── tyro-dashboard/
│               └── partials/
│                   ├── user-sidebar.blade.php  ← Link added here (user/common pages)
│                   └── admin-sidebar.blade.php ← Link added here (admin/common pages)
└── routes/
    └── web.php                                 ← Route added here
Note: The $user variable is automatically available in all dashboard pages through a global view composer, so you don't need to pass it manually from routes or controllers.
Pro Tip: Use these commands to quickly scaffold dashboard sections for analytics, reports, settings, or any custom functionality your application needs.

Page Removal Commands

Remove dashboard pages that were created with the page creation commands. These commands safely delete view files, routes, and sidebar links.

tyro-dashboard:remove-user-page

Remove a user-facing dashboard page.

php artisan tyro-dashboard:remove-user-page

# Direct mode
php artisan tyro-dashboard:remove-user-page "my-reports"

tyro-dashboard:remove-admin-page

Remove an admin-only dashboard page.

php artisan tyro-dashboard:remove-admin-page

# Direct mode
php artisan tyro-dashboard:remove-admin-page "system-settings"

tyro-dashboard:remove-common-page

Remove a common dashboard page (removes from both sidebars).

php artisan tyro-dashboard:remove-common-page

# Direct mode
php artisan tyro-dashboard:remove-common-page "help-center"

What removal commands do:

  • Delete the Blade view file from resources/views/dashboard/
  • Remove the route from routes/web.php
  • Remove the sidebar link(s) from the appropriate sidebar file(s)
  • Show a warning and ask for confirmation before deletion
  • Display "Page not found" message if the page doesn't exist
⚠️ Warning: These commands permanently delete files. Always confirm you're removing the correct page before proceeding.

Routes Reference

Complete list of routes provided by Tyro Dashboard:

Route Description Access
/dashboard Main dashboard home page All Authenticated
/dashboard/profile User profile settings All Authenticated
/dashboard/users User management list Admin Only
/dashboard/users/create Create new user Admin Only
/dashboard/users/{id}/edit Edit user details Admin Only
/dashboard/roles Role management list Admin Only
/dashboard/roles/create Create new role Admin Only
/dashboard/roles/{id} View role details Admin Only
/dashboard/privileges Privilege management list Admin Only
/dashboard/privileges/create Create new privilege Admin Only
/dashboard/settings/tyro Tyro package settings Admin Only
/dashboard/settings/tyro-login Tyro Login settings Admin Only

Access Control

Tyro Dashboard implements role-based access control:

Admin & Super-Admin

Users with admin roles have full access to:

  • User management (create, edit, suspend, delete)
  • Role management (create, edit, delete)
  • Privilege management (create, edit, delete)
  • Package settings configuration
  • Dashboard home and statistics

Regular Users

Users without admin roles can only access:

  • Dashboard home page
  • Profile management (their own profile)
Configurable: Admin roles can be configured via the admin_roles setting in config/tyro-dashboard.php.

Frequently Asked Questions

Can I use Tyro Dashboard without Tyro Login?

Yes! Tyro Dashboard only requires the Tyro RBAC package. Tyro Login is optional and adds beautiful authentication pages. Without Tyro Login, you'll use Laravel's default authentication.

How do I change the dashboard URL?

Set TYRO_DASHBOARD_PREFIX=admin in your .env file to change from /dashboard to /admin.

How do I add more admin roles?

Edit the admin_roles array in config/tyro-dashboard.php to include additional role slugs.

Can I customize the dashboard views?

Yes! Run php artisan vendor:publish --tag=tyro-dashboard-views to publish views to resources/views/vendor/tyro-dashboard/ where you can modify them.

Why can't I delete certain roles?

Critical roles like admin, super-admin, and user are protected and cannot be deleted through the dashboard to prevent accidental lockout.

Does Tyro Dashboard work with dark mode?

Yes! Tyro Dashboard includes built-in dark/light theme support. The theme respects user preferences and system settings, with a manual toggle available.

← Back to Home View on GitHub