Routes and Middleware Reference

Where every route comes from, what wraps it, and the names to use so your plugin's routes sit comfortably next to the core's. To see the live list on a site, run php artisan route:list --path=admin/bookings (or any prefix).

Route files

FileLoadedContains
routes/web.phpBy Laravel, in the web groupThe two wrappers below, plus an installer compatibility route
routes/admin.phpInside AdminTheme, prefix config('dotartisan.admin_prefix'), names admin.*Every core admin screen, behind auth, verified, 2fa and a ->can() per route
routes/admin_auth.phpRequired by admin.phpAdmin sign-in, password reset and e-mail verification
routes/front.phpInside FrontThemeHome, contact, blog, category and tag pages, the demo showcase; requires auth.php
routes/auth.phpRequired by front.phpVisitor sign-in, registration, password reset, social sign-in (localized)
routes/app.phpInside FrontThemeThe signed-in visitor area /user/*: dashboard, profile, security, API tokens, teams, tickets
routes/api.phpBy Laravel, prefix api, api groupOne Sanctum endpoint: GET /api/v1/whoami
routes/breadcrumbs.phpBy the breadcrumbs packageBreadcrumb definitions for core named routes
routes/console.phpBy LaravelCore schedule (pages:refresh-bound hourly)
routes/channels.phpBy LaravelThe default private user channel (broadcasting is not used)
catch-all{slug}FrontendRoutingServiceProvider, after every other routeresolve.show: pages, posts, Booking services and anything else with a resolvable slug
Modules/*/routes/*.phpEach module's RouteServiceProviderNever required from core route files

Middleware aliases

AliasPurpose
auth, guestSession authentication
verifiedE-mail verified (Laravel)
2faTwo-factor check for admin routes
role, permission, role_or_permissionRole and permission guards, for example permission:access trupayments on a group
AdminThemeAdmin theme, core sidebar and settings, then the AdminBooting event
FrontThemePublic theme, compiled stylesheet URL, locale from the session, text direction
doCache, doNotCacheResponse cache opt-in and opt-out
RedirectIfInstalledInstaller-only routes
throttle:page-builder-aiThe AI assistant's rate limiter

Two classes are used directly rather than by alias: App\Http\Middleware\TwoFactorMiddleware protects the public account area and the catch-all route, and App\Http\Middleware\DemoClearance runs in the web group and blocks write routes for the demo accounts when APP_DEMO is on.

Stacks to copy

Modules/Testimonials/app/Providers/RouteServiceProvider.php

use App\Http\Middleware\AdminTheme;
use App\Http\Middleware\FrontTheme;

public function map(): void
{
    // Admin screens: same protection as the core admin
    Route::middleware(['web', 'auth', 'verified', '2fa', AdminTheme::class])
        ->as('admin.testimonials.')
        ->prefix(config('dotartisan.admin_prefix', 'admin') . '/testimonials')
        ->group(module_path($this->name, '/routes/admin.php'));

    // Public pages
    Route::middleware(['web', FrontTheme::class])
        ->as('testimonials.')
        ->prefix('testimonials')                     // also list it in module.json "public_paths"
        ->group(module_path($this->name, '/routes/front.php'));
}

Naming

KindPatternExample
Core adminadmin.{resource}[.{action}]admin.pages.edit
Module adminadmin.{alias}.{resource}.{action}admin.booking.services.store
Module public{alias}.{page}booking.services.index, trucommerce.shop.index
Visitor areauser.*user.profile
Paymentstrupayments.*trupayments.pay, trupayments.webhook

End admin write routes in .store, .update, .destroy or .delete: demo mode blocks the demo accounts by route-name patterns such as admin.*.store and admin.*.*.update. Give every named page route a breadcrumb definition, or the admin layout throws.

URLs that cannot be used

Useful commands

php artisan route:list --path=admin/testimonials     # one prefix
php artisan route:list --name=testimonials           # by name
php artisan route:list --except-vendor               # skip package routes
php artisan route:clear                               # after editing route files on a site with cached routes