almasaeed2010/adminlte
AdminLTE is a fully responsive, MIT-licensed admin dashboard template built on Bootstrap 5.3 with vanilla JavaScript and no jQuery. Highly customizable, it adapts to every screen from mobile to desktop and is the most popular open-source dashboard UI.
Install the package:
composer require colorlibhq/adminlte-laravel
Publish assets and config:
php artisan vendor:publish --provider="ColorlibHQ\AdminLTE\AdminLTEServiceProvider" --tag="adminlte-assets"
php artisan vendor:publish --provider="ColorlibHQ\AdminLTE\AdminLTEServiceProvider" --tag="adminlte-config"
On AdminLTE v4.10.1: the underlying theme ships CSS/JS fixes (Responsive/tablet header overflow, fullscreen icon sync, table semantics/labels, light–dark contrast). Re-run the
adminlte-assetspublish (with--force) whenever you bump the frontend version, otherwise you keep serving staledist/files and none of the fixes land.
Add AdminLTE to your layout:
Include the published blade file in your resources/views/layouts/app.blade.php:
@extends('adminlte::page')
First use case:
Create a simple dashboard page at resources/views/dashboard.blade.php:
@extends('adminlte::page')
@section('title', 'Dashboard')
@section('content_header')
<h1>Dashboard</h1>
@stop
@section('content')
<p>Welcome to your AdminLTE dashboard!</p>
@stop
config/adminlte.php: Customize theme, layout, and menu.resources/views/vendor/adminlte/: Published blade templates (modify as needed).devEngines) and npm 10+. This does not affect composer required assets.Leverage the config-driven menu system to build navigation dynamically:
// config/adminlte.php
'menu' => [
[
'text' => 'Dashboard',
'url' => '/dashboard',
'icon' => 'fas fa-tachometer-alt',
],
[
'text' => 'Users',
'url' => '/users',
'icon' => 'fas fa-users',
'submenu' => [
['text' => 'List', 'url' => '/users/list'],
['text' => 'Create', 'url' => '/users/create'],
],
],
],
Usage in Blade:
@include('adminlte::menu')
Override default colors/skins via config:
// config/adminlte.php
'skin' => 'blue', // Options: 'blue', 'black', 'purple', 'yellow', 'red', 'green', 'teal', 'orange'
'sidebar_mini' => true, // Collapse sidebar by default
Use built-in sections:
@extends('adminlte::page')
@section('title', 'Page Title')
@section('content_header')
<h1>Header Content</h1>
<small>Subheader text</small>
@stop
@section('content')
<!-- Main content -->
@stop
@section('css')
<link rel="stylesheet" href="/css/custom.css">
@stop
@section('js')
<script src="/js/custom.js"></script>
@stop
Generate auth views with:
php artisan adminlte:auth
This creates:
resources/views/auth/.Include pre-built widgets:
<div class="row">
<div class="col-12 col-sm-6 col-md-3">
@include('adminlte::widget_box', [
'title' => 'Quick Example',
'icon' => 'fa fa-file-code-o',
'content' => 'Create an amazing page',
])
</div>
</div>
The 4.10.1 release specifically tightened table filter labels/grid semantics and isolated fullscreen toggles from card-maximize controls. Wrap tabular widgets accordingly so you inherit the fixes rather than overriding them:
<div class="card">
<div class="card-header">
<h3 class="card-title">Users</h3>
<div class="card-tools">
<label class="visually-hidden" for="user-filter">Filter users</label>
<input id="user-filter" type="search" class="form-control form-control-sm" placeholder="Filter">
</div>
</div>
<div class="card-body table-responsive p-0">
<table class="table table-hover" role="grid" aria-label="Users">
{{-- ... --}}
</table>
</div>
</div>
Laravel 11/12 apps default to Vite; Mix still works. Either way, compile your custom CSS/JS around AdminLTE rather than recompiling its dist/:
// webpack.mix.js (Mix apps)
mix.js('resources/js/app.js', 'public/js')
.sass('resources/scss/app.scss', 'public/css')
.copy('node_modules/admin-lte/dist', 'public/admin-lte');
// vite.config.js (Vite apps) — copy the prebuilt dist, don't re-bundle it
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
plugins: [laravel({ input: ['resources/css/app.css', 'resources/js/app.js'] })],
});
AdminLTE's demo pages wire in CDN libraries. In 4.10.1 these were refreshed: FullCalendar migrated to 7.1.1, jsVectorMap asset paths corrected, and integrity hashes rotated. If you copied those demo snippets into your app, treat this release as the reference implementation and re-copy rather than hand-patching.
Asset Paths:
public/admin-lte are correct.dist/ from compilation to avoid duplication.Stale Assets After Upgrading (v4.10.x):
composer update alone does not refresh published assets. Run:
php artisan vendor:publish --provider="ColorlibHQ\AdminLTE\AdminLTEServiceProvider" --tag="adminlte-assets" --force
php artisan view:clear
dist/ is refreshed.CDN + SRI Hashes:
integrity="...", the browser silently blocks the file on mismatch (blank styles, dead widgets). Update the hashes or drop SRI in favour of a local build.FullCalendar 7 Migration:
jsVectorMap Paths:
/plugins/jvectormap/... references will 404. Point at the packaged path (node_modules/jsvectormap/dist/...) instead.Bootstrap 5 Migration:
data-bs-toggle instead of data-toggle)..modal classes may need adjustments (e.g., .modal-dialog sizing).data-bs-toggle="dropdown".Dark Mode:
'dark_mode' => true,
document.body.setAttribute('data-bs-theme', 'dark');
Sidebar Collapse:
data-lte-toggle="sidebar" for manual toggling:
<button class="btn" data-lte-toggle="sidebar">
<i class="fas fa-bars"></i>
</button>
Clear Published Assets:
If changes to resources/views/vendor/adminlte/ don't reflect, clear compiled views:
php artisan view:clear
Check Config Overrides:
Ensure no cached config is overriding your adminlte.php settings:
php artisan config:clear
JavaScript Conflicts: AdminLTE uses vanilla JS. If plugins fail:
adminlte.min.js)..card-tools .btn may now fire on the fullscreen button only — re-scope selectors to .card-maximize.RTL Support: Enable in config:
'rtl' => true,
Ensure your app's locale is RTL-compatible (e.g., app.php in Laravel).
Build vs. Consume Confusion:
If npm ci fails with an engine error, you're on a source-build path (AdminLTE repo checkout / devEngines) — it needs Node 22.22.3+/24.16.0+/26.3.0+. Plain package consumers only need Node >= 20.
npm audit Noise:
4.10.1 documents 20 high-severity findings inherited from the unpatched braces advisory. These live in dev-only tooling and are not in the published runtime dependency tree. Don't chase them in an app audit; they're upstream-blocked.
Custom Blade Directives:
Extend AdminLTE's directives in AppServiceProvider:
Blade::directive('adminlteBox', function ($expression) {
return "<?php echo \\ColorlibHQ\\AdminLTE\\Widgets::box($expression); ?>";
});
Override Widgets:
Copy resources/views/vendor/adminlte/widgets/ to your project and modify.
Add Custom Plugins:
Include third-party plugins in resources/views/layouts/app.blade.php:
@section('extra_css')
<link rel="stylesheet" href="https://cdn.datatables.net/1.11.5/css/dataTables.bootstrap5.min.css">
@stop
@section('extra_js')
<script src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.11.5/js/dataTables.bootstrap5.min.js"></script>
@stop
Dynamic Theming: Change themes via JavaScript:
function setTheme(theme) {
document.body.setAttribute('data-bs-theme', theme);
localStorage.setItem('adminlte-theme', theme);
}
<script src="/admin-lte/dist/js/adminlte.min.js" defer></script>
Route Caching: After adding menu items, regenerate routes:
php artisan route:clear
Middleware:
Protect admin routes with admin middleware (included by default):
Route::middleware(['auth', 'admin'])->group(function () {
// Admin routes
});
Localization:
AdminLTE supports Laravel's localization. Override translations in resources/lang/.
Testing:
Use adminlte::page in feature tests:
$response = $this->actingAs($user)->get('/dashboard');
$response->assertSee('Dashboard');
Upgrading to 4.10.1 Safely:
There are no public component API changes and no Composer/PHP version bumps in this release, so a patch bump is low-risk. The upgrade checklist is: clear adminlte-assets cache via re-publish, rotate any SRI hashes, re-verify FullCalendar 7 and jsVectorMap usages, then re-run your own contrast/responsive smoke tests if you maintain dark-mode overrides.
How can I help you explore Laravel packages today?