### adminlte:install command examples Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/commands.md Shows various ways to run the install command: full interactive install, non-interactive with --no-interaction-deps, publishing only config, views with --force, and language files. ```bash php artisan adminlte:install ``` ```bash php artisan adminlte:install --no-interaction-deps ``` ```bash php artisan adminlte:install --only=config ``` ```bash php artisan adminlte:install --only=views --force ``` ```bash php artisan adminlte:install --only=lang ``` -------------------------------- ### Install adminlte-laravel and run adminlte:install Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/README.md Installs the package and runs the installer, which publishes config/adminlte.php, drops Vite entry stubs into resources/js/adminlte.js and resources/css/adminlte.css, and offers to npm install the frontend dependencies pinned to tested major versions. Optional plugins are listed separately; install them only if enabled, then run php artisan adminlte:install --only=assets to copy their files into public/vendor. ```bash composer require colorlibhq/adminlte-laravel php artisan adminlte:install ``` -------------------------------- ### Plain auth setup flow Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/authentication.md Complete flow to set up plain authentication with AdminLTE: install scaffolding, generate auth, migrate, and build assets. After this, visit /register or /login to create an account or sign in. ```bash # 1. Install the package scaffolding (config, assets, npm deps) php artisan adminlte:install # 2. Scaffold plain authentication (controllers + routes) php artisan adminlte:make-auth # 3. Make sure Laravel's default auth tables exist (users, password_reset_tokens) php artisan migrate # 4. Build the frontend npm run dev # or: npm run build ``` -------------------------------- ### Install broadcasting (Reverb) Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/realtime.md Installs the broadcasting package and adds the REVERB_* keys to .env. Choose Reverb when prompted. ```bash php artisan install:broadcasting ``` -------------------------------- ### adminlte:make-auth Usage Examples Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/commands.md Examples showing how to run the command for different authentication types and force overwriting of existing files. ```bash # Plain auth (controllers + routes) php artisan adminlte:make-auth # Plain auth, overwrite existing controllers php artisan adminlte:make-auth --type=plain --force # Breeze integration guidance php artisan adminlte:make-auth --type=breeze # Fortify integration guidance php artisan adminlte:make-auth --type=fortify ``` -------------------------------- ### Run the AdminLTE installer Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/installation.md Run the installer to publish config, Vite entry stubs, and copy plugin vendor files. Offers to npm install frontend dependencies. ```bash php artisan adminlte:install ``` -------------------------------- ### GateFilter configuration examples Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/menu.md Examples of menu items using the 'can' key for authorization and 'can_params' for passing model arguments. ```php ['text' => 'Admin Panel', 'url' => 'admin', 'can' => 'access-admin'], ['text' => 'Edit Post', 'route' => 'posts.edit', 'can' => 'update', 'can_params' => $post], ``` -------------------------------- ### Install Sanctum and Scaffold API Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/api.md Run these commands to install Sanctum, scaffold the AdminLTE API management features, and run migrations. ```bash php artisan install:api # pulls in Sanctum + personal_access_tokens migration + routes/api.php php artisan adminlte:scaffold api php artisan migrate ``` -------------------------------- ### Clone and install dependencies Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/contributing.md Clone the repository and install Composer dependencies for local development. ```bash git clone https://github.com/colorlibhq/adminlte-laravel.git cd adminlte-laravel composer install ``` -------------------------------- ### Install AdminLTE and build assets Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/deployment.md Runs the adminlte:install artisan command to publish config, stubs, npm dependencies, and vendor files. Then installs npm dependencies and builds assets. Requires adding two entries to vite.config.js as per installation.md. ```bash php artisan adminlte:install # publishes config/stubs, npm deps, vendor files # add the two entries to vite.config.js (see installation.md), then: npm ci npm run build ``` -------------------------------- ### Install optional plugins and re-run asset step Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/installation.md Install optional plugins (Flatpickr, Tom Select, Tabulator, Quill) and re-run the asset step to copy their files into public/vendor/. Without the second command, the plugin's script tag 404s and the component silently does nothing. ```bash npm install -D flatpickr@^4.6 tom-select@^2.6 tabulator-tables@^6.5 quill@^2.0 ``` ```bash php artisan adminlte:install --only=assets ``` -------------------------------- ### Verify installation with adminlte:status Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/installation.md Check which resources are installed, including config, stubs, published views, npm packages, plugin vendor files, and scaffolded sections. ```bash php artisan adminlte:status ``` -------------------------------- ### SmallBox component example Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md Example of the component with title, text, icon, theme, url, and urlText. The url and urlText define the footer link. ```blade ``` -------------------------------- ### adminlte:install command signature Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/commands.md Shows the command signature for adminlte:install, including the --only, --force, and --no-interaction-deps options. Use this to understand the available flags and their purposes when running the install command. ```text adminlte:install {--only= : Install only a specific resource (config|views|assets|lang)} {--force : Overwrite existing files} {--no-interaction-deps : Skip the npm install prompt} ``` -------------------------------- ### Breeze mode: install Breeze, re-publish views, and run adminlte:make-auth --type=breeze Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/authentication.md Install Breeze, re-publish AdminLTE views, and generate auth scaffolding in Breeze mode. The first two commands are prerequisites; the third is the main command. No routes are needed because Breeze registers them. ```bash composer require laravel/breeze --dev php artisan breeze:install blade ``` ```bash php artisan adminlte:install --only=views ``` ```bash php artisan adminlte:make-auth --type=breeze ``` -------------------------------- ### Build the client Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/realtime.md Installs npm dependencies and builds the frontend assets, including laravel-echo and the Reverb client. ```bash npm install && npm run build ``` -------------------------------- ### Next steps after installation Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/commands.md Printed as the next steps. Ensure resources/js/adminlte.js and resources/css/adminlte.css are in vite.config.js input, run npm run dev or build, extend the layout with @extends('adminlte::page'), and configure the sidebar menu in config/adminlte.php. ```text 1. Ensure resources/js/adminlte.js & resources/css/adminlte.css are in your vite.config.js input. 2. Run npm run dev (or npm run build). 3. Extend the layout in a view: @extends('adminlte::page') 4. Configure your sidebar menu in config/adminlte.php. ``` -------------------------------- ### InfoBox component example Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md Example of the component with title, text, icon, theme, progress, and progressText. The progress prop renders a progress bar with the given value. ```blade ``` -------------------------------- ### Define menu configuration structure Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/menu.md A realistic example of the menu array, demonstrating headers, simple links, treeviews with badges and authorization gates, and external links. ```php 'menu' => [ // Section header ['header' => 'MAIN'], // Simple link [ 'text' => 'Dashboard', 'route' => 'dashboard', 'icon' => 'bi bi-speedometer', ], // Treeview with a badge on the parent and an authorization gate [ 'text' => 'Shop', 'icon' => 'bi bi-bag', 'label' => 3, 'label_color' => 'danger', 'can' => 'manage-shop', 'submenu' => [ ['text' => 'Orders', 'route' => 'orders.index', 'icon' => 'bi bi-circle'], ['text' => 'Products', 'route' => 'products.index', 'icon' => 'bi bi-circle'], ], ], ['header' => 'OTHER'], // External link opening in a new tab [ 'text' => 'Documentation', 'url' => 'https://adminlte.io/docs', 'icon' => 'bi bi-book', 'target' => '_blank', ], // Colored-icon link [ 'text' => 'Important', 'url' => '#', 'icon' => 'bi bi-exclamation-triangle', 'icon_color' => 'warning', ], ], ``` -------------------------------- ### Install optional plugin and copy assets Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/plugins.md Two commands to add an optional plugin like Quill after installation: first fetch the library with npm, then copy it into public/vendor using --only=assets. Missing sources are skipped silently, so the second command is safe to re-run. Skipping step 2 causes a 404 for the plugin script and an empty editor box. ```bash npm install -D quill@^2.0 # 1. fetch the library php artisan adminlte:install --only=assets # 2. copy it into public/vendor ``` -------------------------------- ### Create the preview app with Composer Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/deployment.md Creates a new Laravel project named 'adminlte-preview' and installs the AdminLTE package. Requires PHP 8.3+, Composer 2.x, and Node.js 18+. ```bash composer create-project laravel/laravel adminlte-preview cd adminlte-preview composer require colorlibhq/adminlte-laravel ``` -------------------------------- ### Breadcrumb Component Example Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md An example of rendering a breadcrumb trail using the component with an array of items. ```blade ``` -------------------------------- ### Minimal Blade page example using adminlte::page layout Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/layout.md A complete Blade template that extends the adminlte::page layout, defines a title, content header, and content section, and pushes custom CSS and JavaScript. Use this as a starting point for any page in the AdminLTE Laravel project. ```blade @extends('adminlte::page') @section('title', 'Reports') @section('content_header')

Reports

@stop @section('content')

Your content here.

@stop @push('css') @endpush @push('js') @endpush ``` -------------------------------- ### Calendar component example Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md Renders an event calendar using the FullCalendar plugin. The events prop accepts an array of event objects with title and start date. The height prop sets the calendar height. ```blade ``` -------------------------------- ### Install core frontend dependencies via npm Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/commands.md Runs when the user accepts the prompt to install frontend dependencies. Pins each package to the major version the package is built and tested against, preventing breaking upstream majors. fullcalendar is held below v7 because that release drops the minified global bundle and replaces bundled CSS. ```bash npm install -D admin-lte@^4.8 bootstrap@^5.3 @popperjs/core@^2.11 overlayscrollbars@^2.16 \ bootstrap-icons@^1.13 apexcharts@^6.8 jsvectormap@^1.7 fullcalendar@^6.1 \ sortablejs@^1.15 sass@^1.102 ``` -------------------------------- ### Accordion Component Example Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md An example of an accordion container with two collapsible items using the and components. ```blade Everything you need. Within 30 days. ``` -------------------------------- ### Scaffold authentication commands Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/authentication.md Examples of running the command to scaffold plain authentication and to re-scaffold while overwriting existing controllers. ```bash # Scaffold plain auth (controllers + routes) php artisan adminlte:make-auth # Re-scaffold, overwriting the controllers php artisan adminlte:make-auth --type=plain --force ``` -------------------------------- ### Fortify integration steps Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/authentication.md Steps to integrate Fortify with AdminLTE: install the package, point Fortify's views at AdminLTE in FortifyServiceProvider, then run the make-auth command with the fortify type. ```bash composer require laravel/fortify ``` ```php Fortify::loginView(fn () => view('adminlte::auth.login')); Fortify::registerView(fn () => view('adminlte::auth.register')); ``` ```bash php artisan adminlte:make-auth --type=fortify ``` -------------------------------- ### Run Reverb and queue servers Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/realtime.md Start the WebSocket server and, if the event implements ShouldBroadcast, run the queue worker. ```bash php artisan reverb:start php artisan queue:work # if the event implements ShouldBroadcast (queued) ``` -------------------------------- ### Example plugin configuration in config/adminlte.php Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/plugins.md Shows the structure of the 'plugins' array. Each plugin can have 'enabled', 'css', and 'js' keys. The 'css' and 'js' values can be a single string or an array of strings. Paths are resolved via Laravel's asset() helper. ```php 'plugins' => [ 'apexcharts' => [ 'enabled' => false, 'js' => 'vendor/apexcharts/apexcharts.min.js', ], 'jsvectormap' => [ 'enabled' => false, 'css' => 'vendor/jsvectormap/jsvectormap.min.css', 'js' => [ 'vendor/jsvectormap/jsvectormap.min.js', 'vendor/jsvectormap/maps/world.js', ], ], ], ``` -------------------------------- ### Alert component example Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md Example of the component with theme, icon, title, and dismissable. The dismissable prop renders a close button. ```blade Your changes were stored successfully. ``` -------------------------------- ### Card component example Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md Example of the component with title, icon, theme, collapsible, tools slot, and footer slot. The tools slot is used for header toolbar buttons, and the footer slot for card footer content. ```blade Monthly revenue chart goes here. Updated 2 minutes ago ``` -------------------------------- ### x-adminlte-input-tom-select usage example Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md Renders a Tom Select enhanced select with multiple selection enabled. The example sets name="tags", label="Tags", multiple, and provides options as a value => label array. The tom_select plugin is enabled automatically. ```blade ``` -------------------------------- ### adminlte:scaffold Usage Examples Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/commands.md Various ways to invoke the scaffold command, including interactive mode, single section generation, and bulk operations with seeding or force overwriting. ```bash # Interactive multi-select picker php artisan adminlte:scaffold # Scaffold one section php artisan adminlte:scaffold kanban # Scaffold one section, then migrate and seed demo data php artisan adminlte:scaffold mailbox --seed # Scaffold everything php artisan adminlte:scaffold --all # Re-scaffold and overwrite customizations php artisan adminlte:scaffold projects --force # Roles & permissions layer (HasRoles on User, users/roles UI), seeded php artisan adminlte:scaffold rbac --seed ``` -------------------------------- ### x-adminlte-button usage example Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md Renders a themed Bootstrap button with an icon and label. The example uses type="submit", theme="success", icon="bi bi-save", and label="Save changes". The label prop is an alternative to the slot content. ```blade ``` -------------------------------- ### Retrieve scoped menus Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/menu.md Examples of using the AdminLte singleton to retrieve filtered menu items for specific scopes. ```php app('adminlte')->menu('sidebar'); // items not flagged topnav-only app('adminlte')->menu('navbar-left'); // items with 'topnav' => true app('adminlte')->menu('navbar-right'); // items with 'topnav_right' => true app('adminlte')->menu(); // the full filtered list ``` -------------------------------- ### Chart Component Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md A bar chart example using the ApexCharts plugin. ```blade ``` -------------------------------- ### Generate demo route URLs with route() Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/demo-pages.md Shows how route names are derived from demo URLs: slashes become dots and the adminlte. prefix is added. These examples correspond to demo/dashboard-v2, demo/forms/wizard, and demo/errors/404. ```php route('adminlte.demo.dashboard-v2'); // demo/dashboard-v2 route('adminlte.demo.forms.wizard'); // demo/forms/wizard route('adminlte.demo.errors.404'); // demo/errors/404 ``` -------------------------------- ### Scaffold mailbox section with artisan Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/scaffolding.md Use the adminlte:scaffold command to generate mailbox files. You can run it with the --seed flag for a one-shot setup or execute the steps individually. ```bash # 1. Scaffold the mailbox section (publishes migration, model, controller, # seeder, views, and routes) and run migrate + seed in one shot. php artisan adminlte:scaffold mailbox --seed # If you prefer to do it in steps: php artisan adminlte:scaffold mailbox php artisan migrate php artisan db:seed --class=AdminLteMailboxSeeder ``` -------------------------------- ### x-adminlte-input-flatpickr usage example Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md Renders a Flatpickr date/time picker input. The example sets name="published_at", label="Publish date", type="datetime", and passes extra options via the options prop (minDate => 'today'). The flatpickr plugin is enabled automatically. ```blade ``` -------------------------------- ### Use API token with cURL Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/api.md Example of how to authenticate an API request using a Bearer token in the Authorization header. ```bash curl -H "Authorization: Bearer {token}" -H "Accept: application/json" \ https://your-app.test/api/user ``` -------------------------------- ### Set application locale at runtime Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/translations.md Example of changing the active locale programmatically. ```php App::setLocale('de'); ``` -------------------------------- ### Editor Component Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md A rich-text WYSIWYG editor example backed by the Quill plugin. ```blade ``` -------------------------------- ### Wizard with steps example Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md Renders a multi-step form wizard. The wizard component takes a steps prop and wraps wizard-step components. Each step has a step number and title, and contains step content. ```blade Review and submit. ``` -------------------------------- ### Progress component example Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md Displays a single Bootstrap progress bar with a value of 65, success theme, striped and animated styles, a visible label, and a custom height of 12px. ```blade ``` -------------------------------- ### Modal Component Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md A Bootstrap modal dialog example with a custom footer slot. ```blade Are you sure you want to continue? ``` -------------------------------- ### Datatable Component Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md An interactive data table example using the Tabulator plugin. ```blade ``` -------------------------------- ### Dockerfile for PHP-FPM application Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/deployment.md A multi-stage Dockerfile setup for the application. Ensure you serve the public/ directory with Nginx in front of the resulting PHP-FPM container. ```dockerfile FROM php:8.3-fpm AS app WORKDIR /var/www/html RUN apt-get update && apt-get install -y nodejs npm \ && docker-php-ext-install pdo pdo_mysql bcmath COPY composer.json composer.lock ./ RUN composer install --no-dev --optimize-autoloader COPY package*.json ./ RUN npm ci COPY . . RUN npm run build \ && php artisan config:cache && php artisan route:cache && php artisan view:cache ``` -------------------------------- ### VectorMap Component Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md An interactive vector map example using the jsVectorMap plugin. ```blade ``` -------------------------------- ### Kanban board example Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md Renders a drag-and-drop Kanban board using the SortableJS plugin. The lanes prop defines lanes with cards, each card having a title and optional color. ```blade ``` -------------------------------- ### ProgressGroup component example Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md Shows a labeled progress bar with a value of 160 out of a maximum of 200, using the info color theme. The percentage is computed automatically. ```blade ``` -------------------------------- ### DescriptionBlock component example Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md Creates a titled block with a muted description and a definition list of key/value pairs. The items array maps labels to values. ```blade ``` -------------------------------- ### Add auth:sanctum route Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/api.md Example endpoint added to routes/api.php to verify authentication using the auth:sanctum middleware. ```php Route::middleware('auth:sanctum')->get('/user', fn (Request $r) => $r->user()); ``` -------------------------------- ### Callout component example Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md Renders a callout box with a warning theme and a heading. The body content is placed inside the component's slot. ```blade This action cannot be undone. ``` -------------------------------- ### Production Environment Variables Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/deployment.md Set these variables in your .env file for a production deployment. This configuration assumes a dedicated subdomain setup. ```dotenv APP_ENV=production APP_DEBUG=false APP_URL=https://laravel.adminlte.io ``` -------------------------------- ### Define a top navbar menu item Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/menu.md Example of placing a menu item in the right side of the top navbar by setting 'topnav_right' to true. ```php // Place an item in the right side of the top navbar instead of the sidebar: ['text' => 'Help', 'url' => 'help', 'icon' => 'bi bi-question-circle', 'topnav_right' => true], ``` -------------------------------- ### Require the package with Composer Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/installation.md Install the AdminLTE 4 Laravel package via Composer. Requires PHP 8.3+ and Laravel 13. ```bash composer require colorlibhq/adminlte-laravel ``` -------------------------------- ### Timeline component example Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md Renders a vertical timeline from an array of items. Each item can include icon, icon_bg, title, body, url, and footer keys. ```blade ``` -------------------------------- ### Scaffold the full demo Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/deployment.md Generates authentication scaffolding and all database-backed sections with demo data, then runs migrations. Requires a configured database (SQLite is fine for demo). ```bash php artisan adminlte:make-auth # login/register/etc. php artisan adminlte:scaffold --all --seed # all DB-backed sections + demo data php artisan migrate --force ``` -------------------------------- ### Create a page with AdminLTE Blade layout Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/README.md Example Blade layout for a page using the adminlte::page layout. Defines the title, content header, and content sections with AdminLTE components like small-box, info-box, card, input, and button. ```blade @extends('adminlte::page') @section('title', 'Dashboard') @section('content_header')

Dashboard

@stop @section('content')
@stop ``` -------------------------------- ### Configure Vite input for AdminLTE assets Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/README.md Adds the two entry files to your vite.config.js so the Vite asset pipeline processes the AdminLTE CSS and JS. Required after installation before building assets. ```js laravel({ input: [ 'resources/css/adminlte.css', 'resources/js/adminlte.js', ], refresh: true, }), ``` -------------------------------- ### Deployment Optimization Commands Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/deployment.md Run these commands to generate the application key, cache configurations, routes, and views, and to set correct permissions for storage and cache directories. ```bash php artisan key:generate php artisan config:cache php artisan route:cache php artisan view:cache chmod -R ug+rw storage bootstrap/cache ``` -------------------------------- ### Build assets with npm Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/installation.md Run npm run dev for development with HMR, or npm run build for production. ```bash npm run dev # development (HMR) # or npm run build # production ``` -------------------------------- ### Update procedure for the preview Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/deployment.md Run these commands to update the application code and rebuild assets after pulling changes from the repository. ```bash git pull # or composer update colorlibhq/adminlte-laravel composer install --no-dev -o npm ci && npm run build php artisan migrate --force php artisan config:cache && php artisan route:cache && php artisan view:cache ``` -------------------------------- ### Configure Vite with entry files Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/installation.md Add the two entry files to vite.config.js to wire Vite for the AdminLTE assets. ```js import { defineConfig } from 'vite' import laravel from 'laravel-vite-plugin' export default defineConfig({ plugins: [ laravel({ input: [ 'resources/css/adminlte.css', 'resources/js/adminlte.js', ], refresh: true, }), ], }) ``` -------------------------------- ### Scaffold Activity Log and Run Migrations Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/activity-log.md Run these artisan commands to publish the activity log migration, model, trait, controller, view, test, and route. The migration creates the activity_log table. ```bash php artisan adminlte:scaffold activity-log php artisan migrate ``` -------------------------------- ### Register demo routes with AdminLteServiceProvider Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/demo-pages.md Registers the bundled demo routes. Returns early when config('adminlte.demo') is false, applies the demo_middleware plus DemoUserMenu, and maps each URI to a Blade view with a route name like adminlte.demo.widgets.cards. ```php if (! config('adminlte.demo', true)) { return; } $middleware = config('adminlte.demo_middleware', ['web', 'auth']); $middleware[] = DemoUserMenu::class; Route::middleware($middleware)->group(function () use ($pages) { foreach ($pages as $uri => $view) { Route::view($uri, 'adminlte::'.$view)->name('adminlte.'.str_replace('/', '.', $uri)); } }); ``` -------------------------------- ### adminlte:make-auth next steps output Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/authentication.md The informational output displayed after running the authentication scaffolding command. ```text 1. Auth views ship with the package (adminlte::auth.*) — already wired. 2. Ensure your User model and the password_reset_tokens table exist. 3. Visit /login to sign in. ``` -------------------------------- ### Build frontend assets with npm run dev or build Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/README.md Builds the frontend assets using Vite. Use npm run dev for development or npm run build for production. ```bash npm run dev # or: npm run build ``` -------------------------------- ### Scaffold the profile feature Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/account-management.md Run these commands to generate the profile scaffold, apply the necessary database migration for the avatar column, and link the storage directory for public access. ```bash php artisan adminlte:scaffold profile php artisan migrate # adds the nullable `avatar` column to users php artisan storage:link # so uploaded avatars are publicly served ``` -------------------------------- ### Auto-login Preview Route Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/deployment.md Add this logic to routes/web.php to enable a demo user login via the /preview-login endpoint. Ensure APP_DEMO is set to true in your environment variables. ```php // routes/web.php — PREVIEW ONLY if (env('APP_DEMO', false)) { Route::get('/preview-login', function () { auth()->login(\App\Models\User::firstWhere('email', 'demo@adminlte.io')); return redirect('/'); }); } ``` -------------------------------- ### Publish language files Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/translations.md Command to copy the package's language files into the application's directory for customization. ```bash php artisan adminlte:install --only=lang ``` -------------------------------- ### Configure Badges and Icon Colors Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/menu.md Use 'label' and 'label_color' to add badges to menu items, and 'icon_color' to style icons. 'label_color' defaults to 'primary' if not specified. ```php ['text' => 'Inbox', 'url' => 'admin/mailbox', 'icon' => 'bi bi-envelope', 'label' => 12, 'label_color' => 'danger'], ['text' => 'Important', 'url' => '#', 'icon' => 'bi bi-circle', 'icon_color' => 'danger'], ``` -------------------------------- ### Scaffold dashboard with Artisan command Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/dashboard.md Run this command to publish a DashboardController, a Blade view, the route `adminlte.dashboard` (`/admin/dashboard`), and a DashboardTest. ```bash php artisan adminlte:scaffold dashboard ``` -------------------------------- ### Scaffold realtime feature Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/realtime.md Run this artisan command to publish the realtime scaffold: the NewChatMessage event, the Echo listener bundle, and channel authorization. ```bash php artisan adminlte:scaffold realtime ``` -------------------------------- ### Project layout tree Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/contributing.md Shows the directory structure of the package, including src, resources, config, tests, and docs. ```text src/ AdminLte.php Menu builder (singleton) AdminLteServiceProvider.php Components, directives, demo routes, publishing Console/ install, status, scaffold, make-auth commands Menu/ MenuItemHelper + the filter pipeline Plugins/PluginManager.php Lazy JS-library management View/Components/{Widget,Form,Tool}/ resources/ views/ layouts, partials, components, auth, errors, demo lang/ 9 locales stubs/ Vite entries + scaffold stubs (migrations, models, controllers, seeders, routes, views) config/adminlte.php Published config tests/ Testbench-based tests docs/ This documentation ``` -------------------------------- ### Run adminlte:scaffold command Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/scaffolding.md The command accepts a section name or flags to scaffold application components. ```text adminlte:scaffold [section] [--all] [--force] [--seed] ``` -------------------------------- ### Run quality gates with Composer scripts Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/contributing.md Composer scripts wrap the correct flags for linting, fixing, static analysis, testing, and a combined check. The analyse script includes the required memory limit. ```bash composer lint # code style check (Laravel Pint, PSR-12) composer fix # code style, applying fixes composer analyse # static analysis (Larastan / PHPStan level 8, # with the required --memory-limit baked in) composer test # PHPUnit via Testbench composer check # all three, in CI order ``` -------------------------------- ### Scaffold Impersonation Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/activity-log.md Run this artisan command to publish the ImpersonationController and the impersonate.* routes. ```bash php artisan adminlte:scaffold impersonation ``` -------------------------------- ### Scaffold application sections with adminlte:scaffold Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/README.md Generates complete application sections (migrations, models, controllers, seeders, routes, and data-driven views). Use the interactive multi-select, specify a single section like 'mailbox', or use --all --seed to generate everything with demo data. After scaffolding, run 'php artisan migrate' and visit /admin/{section}. ```bash php artisan adminlte:scaffold # interactive multi-select php artisan adminlte:scaffold mailbox # a single section php artisan adminlte:scaffold --all --seed # everything, with demo data ``` -------------------------------- ### Scaffold Notifications Command Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/notifications.md Run this command to publish the necessary migrations, controllers, views, seeders, and tests for the notifications system. ```bash php artisan adminlte:scaffold notifications --seed ``` -------------------------------- ### Add API tokens menu item Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/api.md Configuration array for adding the API tokens link to the AdminLTE menu. ```php ['text' => 'api_tokens', 'route' => 'adminlte.api-tokens.index', 'icon' => 'bi bi-key'], ``` -------------------------------- ### Search Box Menu Item Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/menu.md Defines a navbar search input identified by 'type' => 'navbar-search'. The 'method', 'placeholder', and 'url' keys are normalized to defaults ('get', 'Search', '#') when omitted. ```php [ 'type' => 'navbar-search', 'method' => 'get', // normalized default 'placeholder' => 'Search', // normalized default 'url' => 'search', // normalized default '#' 'topnav_right' => true, ], ``` -------------------------------- ### Access translation keys Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/translations.md Demonstrates the two ways to resolve translation keys: using the default namespace or the explicit package namespace. ```php __('adminlte.search'); // default namespace (used throughout the views) __('adminlte::adminlte.key'); // explicit package namespace ``` -------------------------------- ### Basic usage of adminlte- components Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md Shows the general syntax for using any AdminLTE component with Laravel's component tag. The alias after the prefix matches the registration map in src/AdminLteServiceProvider.php. ```blade Body content ``` -------------------------------- ### Sortable list example Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md Renders a drag-and-drop sortable list using the SortableJS plugin. The group prop sets the sortable group name for cross-list dragging. The slot contains the list items. ```blade
  • Item 1
  • Item 2
  • ``` -------------------------------- ### Create first page with Blade template Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/installation.md Create a Blade view for the dashboard using AdminLTE layout and components. ```blade {{-- resources/views/dashboard.blade.php --}} @extends('adminlte::page') @section('title', 'Dashboard') @section('content_header')

    Dashboard

    @stop @section('content') @stop ``` -------------------------------- ### Generate authentication with adminlte:make-auth Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/README.md Generates authentication scaffolding. The 'plain' type (default) publishes Login, Register, ForgotPassword, and ResetPassword controllers and registers routes wired to the package's adminlte::auth.* views. Use --type=breeze or --type=fortify for integration guidance. ```bash php artisan adminlte:make-auth # plain (default) php artisan adminlte:make-auth --type=breeze # Breeze integration guidance php artisan adminlte:make-auth --type=fortify # Fortify integration guidance ``` -------------------------------- ### ProfileCard component example Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/components.md Displays a user profile card with avatar, name, title, description, and social links. Social URLs are scheme-checked: http(s), mailto, and relative URLs render as-is; other schemes are replaced with '#'. ```blade ``` -------------------------------- ### Import Echo listeners in Vite entry Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/realtime.md Add this import to resources/js/app.js after Echo is bootstrapped to load the realtime listeners. ```js // resources/js/app.js import './adminlte-realtime' ``` -------------------------------- ### composer test, lint, fix, analyse, check commands Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/CLAUDE.md Defines the Composer scripts for running the test suite, Pint linting (check only), Pint fixes, PHPStan analysis (level 8 with 1G memory limit), and the full CI check sequence. Also shows how to run a single PHPUnit test class or filter specific tests. ```bash composer test # PHPUnit ``` ```bash composer lint # Pint check only (what CI runs) ``` ```bash composer fix # Pint, applying fixes ``` ```bash composer analyse # PHPStan level 8 (bakes in --memory-limit=1G — the bare # `vendor/bin/phpstan` exhausts PHP's default 128M limit) ``` ```bash composer check # lint + analyse + test (the full CI sequence) ``` ```bash # Run a single test class/method vendor/bin/phpunit tests/SmokeTest.php vendor/bin/phpunit tests/SmokeTest.php --filter testComponentsRenderWithoutErrors ``` -------------------------------- ### Proxying php artisan serve with Nginx Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/deployment.md A quick alternative for previews using the built-in PHP server managed by a process manager and proxied through Nginx. ```bash # supervisor / systemd unit php artisan serve --host=127.0.0.1 --port=8000 ``` ```nginx location / { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; } ``` -------------------------------- ### Scaffold RBAC and Seed Roles Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/authorization.md Run the artisan command to publish the RBAC layer, execute migrations, and seed default roles and permissions. ```bash # 1. Publish the RBAC layer, run the migration, and seed roles/permissions. php artisan adminlte:scaffold rbac --seed # 2. Register a user — the first account becomes the admin. # (Scaffold auth first if you haven't: php artisan adminlte:make-auth) # 3. Visit the management UI. # /admin/users and /admin/roles ``` -------------------------------- ### Add menu items at runtime Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/menu.md Use addAfter to insert items relative to an existing menu item or add to append items to the end of the menu. These additions persist for the duration of the request. ```php // Insert directly after the item whose `key`, `text` or `header` matches: app('adminlte')->addAfter('Dashboard', ['header' => 'REPORTS'], ['text' => 'Sales', 'route' => 'reports.sales', 'icon' => 'bi bi-graph-up'], ); // Or simply append to the end of the menu: app('adminlte')->add( ['text' => 'Status', 'url' => 'status', 'icon' => 'bi bi-activity'], ); ``` -------------------------------- ### adminlte:make-auth Command Signature Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/commands.md The command signature defining the available options for authentication scaffolding. ```text adminlte:make-auth {--type=plain : Auth type (plain, breeze, fortify)} {--force : Overwrite existing files} ``` -------------------------------- ### Register permission-aware Gate::before Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/authorization.md The package registers a Gate::before hook that automatically resolves abilities against user permissions. ```php Gate::before(function ($user, string $ability) { if ($user->isAdmin()) return true; // admins pass everything if ($user->hasPermission($ability)) return true; // e.g. @can('manage-projects') return null; // otherwise fall through to policies }); ``` -------------------------------- ### Run a single test Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/contributing.md Run a specific test file and filter to a test method. ```bash vendor/bin/phpunit tests/SmokeTest.php --filter testComponentsRenderWithoutErrors ``` -------------------------------- ### Create route for dashboard Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/installation.md Add a route to serve the dashboard view with authentication middleware. ```php // routes/web.php Route::view('/', 'dashboard')->middleware('auth'); ``` -------------------------------- ### Seed a demo user with tinker Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/deployment.md Creates a demo user with email 'demo@adminlte.io' and password 'password' using Laravel Tinker. The dashboard is behind auth, so this user is needed to access the preview. ```bash php artisan tinker --execute="\App\Models\User::firstOrCreate( ['email' => 'demo@adminlte.io'], ['name' => 'Demo User', 'password' => bcrypt('password')] );" ``` -------------------------------- ### Deploy script for Laravel Forge or managed hosting Source: https://github.com/colorlibhq/adminlte-laravel/blob/master/docs/deployment.md Use this script in your managed hosting provider to handle dependencies, build assets, run migrations, and cache configuration in a single pass. ```bash composer install --optimize-autoloader --no-dev npm ci && npm run build php artisan migrate --force php artisan config:cache && php artisan route:cache && php artisan view:cache ```