almasaeed2010/adminlte
AdminLTE is a popular MIT-licensed admin dashboard template built on Bootstrap 5.3 with vanilla JavaScript (no jQuery). Fully responsive, highly customizable, and easy to use for web apps—from mobile to desktop. Live demo and docs available.
composer require colorlibhq/adminlte-laravel
php artisan vendor:publish --provider="ColorlibHQ\AdminLTE\AdminLTEServiceProvider" --tag="adminlte-assets"
php artisan vendor:publish --provider="ColorlibHQ\AdminLTE\AdminLTEServiceProvider" --tag="adminlte-config"
app/Providers/AppServiceProvider.php:
use ColorlibHQ\AdminLTE\AdminLTE;
public function boot()
{
AdminLTE::init();
}
@extends('adminlte::page')
@section('title', 'Dashboard')
@section('content_header')
<h1>Dashboard</h1>
@stop
@section('content')
<p>Your content here.</p>
@stop
@section('css')
<link rel="stylesheet" href="/css/admin_custom.css">
@stop
@section('js')
<script>console.log('Hi!');</script>
@stop
Replace your resources/views/dashboard.blade.php with:
@extends('adminlte::page')
@section('title', 'Dashboard')
@section('content_header')
<h1>Dashboard</h1>
<small>Control panel</small>
@stop
@section('content')
<div class="row">
<div class="col-lg-3 col-6">
<!-- Small box -->
<div class="small-box bg-info">
<div class="inner">
<h3>150</h3>
<p>New Orders</p>
</div>
<div class="icon">
<i class="ion ion-bag"></i>
</div>
<a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
</div>
</div>
</div>
@stop
Use the menu() helper to generate a sidebar menu from your database or config:
// config/adminlte.php
'menu' => [
[
'text' => 'Dashboard',
'url' => 'home',
'icon' => 'fas fa-tachometer-alt',
],
[
'text' => 'Users',
'url' => 'users',
'icon' => 'fas fa-users',
'submenu' => [
['text' => 'List', 'url' => 'users/list'],
['text' => 'Create', 'url' => 'users/create'],
],
],
],
Render it in your layout:
@include('adminlte::menu')
Leverage Laravel's built-in auth with AdminLTE's layout:
// routes/web.php
Auth::routes();
Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
Use the @auth directive in Blade:
@auth
@include('adminlte::menu')
@endauth
Add widgets to the dashboard using AdminLTE's box components:
<div class="row">
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h3 class="card-title">Quick Example</h3>
</div>
<div class="card-body">
<p>Widget content here.</p>
</div>
</div>
</div>
</div>
Enable dark mode via config:
// config/adminlte.php
'dark_mode' => true,
Or toggle dynamically in Blade:
<button onclick="document.body.setAttribute('data-bs-theme', 'dark')">Dark Mode</button>
Override default components by publishing and modifying:
php artisan vendor:publish --tag=adminlte-views
Edit files in resources/views/vendor/adminlte/.
.wrapper, .main-header.app-wrapper, .app-header
Fix: Update your CSS/JS selectors or use AdminLTE's built-in helpers.AdminLTE v4 uses vanilla JS. If you rely on jQuery plugins:
data-lte-toggle instead of data-toggle).data-bs-toggle).data-bs-theme="dark" (not .dark-mode class).'dark_mode' => true in config/adminlte.php.document.body.setAttribute('data-bs-theme', 'dark');
Manually set active states in the menu config:
'menu' => [
[
'text' => 'Dashboard',
'url' => 'home',
'icon' => 'fas fa-tachometer-alt',
'active' => request()->is('home'),
],
],
{{ AdminLTE::css() }} and {{ AdminLTE::js() }} in Blade.public/vendor/adminlte/.php artisan view:clear if layouts break after updates..app-wrapper).config/adminlte.php for typos in paths or options.Create a new Blade component in resources/views/components/adminlte/:
<!-- resources/views/components/adminlte/custom-card.blade.php -->
<div class="card">
<div class="card-header">{{ $title }}</div>
<div class="card-body">{{ $slot }}</div>
</div>
Use it in views:
<x-adminlte.custom-card title="Custom Title">
<p>Custom content.</p>
</x-adminlte.custom-card>
dist/ assets to production.{{ AdminLTE::js(['adminlte.js', 'custom.js'], true) }} for lazy loading.npm run production in the AdminLTE repo to generate minified assets.| Issue | Solution |
|---|---|
| Menu not rendering | Check config/adminlte.php for valid menu structure. |
| Dark mode not working | Ensure data-bs-theme="dark" is applied to <body>. |
| CSS/JS not loading | Verify assets are published to public/. |
| Widgets overlapping | Use Bootstrap's grid system (e.g., col-md-6). |
| Active menu item not highlighted | Set 'active' => true in menu config. |
AdminLTE::title() for dynamic page titles:
@section('title', AdminLTE::title())
AdminLTE::breadcrumb() for navigation trails:
@include('adminlte::breadcrumb', ['links' => [
['url' => 'home', 'text' => 'Home'],
['text' => 'Users'],
]])
@section('footer')
<strong>Copyright © {{ date('Y') }} <a href="#">Your Company</a>.</strong>
All rights reserved.
@stop
How can I help you explore Laravel packages today?