Skip to main content

AdminController Extension Guide

Overview

The AdminController is a powerful base controller that provides CRUD operations, menu management, and standardized responses for admin interfaces. This guide covers how to create new controllers that extend AdminController.

Quick Start

Basic Controller Structure

Required Properties

Essential Properties (Must Set)

Inertia Page Configuration

Route Configuration

Optional Configuration Properties

Search & Filter Configuration

Example:

Validation Rules

Example:

Pagination & Display

Authorization

Example:

Method Overrides

Query Modification

Override this method to add custom query logic:

Page-Specific Customization

Form Options Setup

Lifecycle Hooks

Create Hooks

Update Hooks

Delete Hooks

Top Menu Level Control

Advanced Features

Custom Actions

Complete Example

Best Practices

  1. Always call parent::__construct() after setting required properties
  2. Set breadcrumbs in each page method for better navigation
  3. Use lifecycle hooks for complex business logic
  4. Configure search and sort fields for better user experience
  5. Add proper validation rules for data integrity
  6. Use consistent naming conventions for routes and pages
  7. Handle authorization through the auth_entity property
  8. Add meaningful extra_props for enhanced UI functionality