Installation
composer require jeroennoten/laravel-adminlte
Publish the package assets and config:
php artisan vendor:publish --provider="JeroenNoten\LaravelAdminLte\AdminLteServiceProvider" --tag=config
php artisan vendor:publish --provider="JeroenNoten\LaravelAdminLte\AdminLteServiceProvider" --tag=assets
Basic Blade Integration
Extend your app.blade.php (or root layout) with the AdminLTE template:
@extends('adminlte::page')
@section('title', 'Dashboard')
@section('content_header')
<h1>Dashboard</h1>
@stop
@section('content')
<p>Welcome to your AdminLTE dashboard!</p>
@stop
@section('css')
<!-- Add custom CSS here -->
@stop
@section('js')
<!-- Add custom JS here -->
@stop
First Use Case: Quick Dashboard
Create a dashboard.blade.php in resources/views/:
@extends('adminlte::page')
@section('title', 'Dashboard')
@section('content_header')
<h1>Dashboard</h1>
@stop
@section('content')
<div class="row">
<div class="col-md-3 col-sm-6 col-12">
<div class="info-box">
<span class="info-box-icon bg-aqua"><i class="fas fa-users"></i></span>
<div class="info-box-content">
<span class="info-box-text">Users</span>
<span class="info-box-number">1,324</span>
</div>
</div>
</div>
</div>
@stop
Layout Customization Override AdminLTE sections in your blade templates:
@section('adminlte_css_pre', '<link rel="stylesheet" href="/custom.css">')
@section('adminlte_js_post', '<script src="/custom.js"></script>')
Sidebar Navigation
Dynamically generate the sidebar using the adminlte helper:
// In a controller or service
$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'],
]],
];
return view('dashboard', compact('menu'));
Render in blade:
@section('adminlte_sidebar')
@include('adminlte::sidebar', ['menu' => $menu])
@stop
Box Components Reuse AdminLTE's box components:
@include('adminlte::box.box', [
'title' => 'Quick Example Box',
'body' => '<p>This is a box body.</p>',
'type' => 'info',
'showBorder' => true,
])
Authentication Integration
Use the auth middleware and extend the login template:
@extends('adminlte::auth.login')
@section('login_title', 'Admin Panel Login')
@section('login_username', 'admin@example.com')
config(['adminlte.theme' => 'blue']);
resources/lang/.Asset Paths
public_path() is correctly configured in config/adminlte.php if using custom paths.php artisan view:clear
Sidebar Collapse
@section('adminlte_sidebar')
@include('adminlte::sidebar', ['menu' => $menu, 'collapse' => false])
@stop
Box Collapse
@include('adminlte::box.box', ['collapsible' => false])
JQuery Dependency
@section('adminlte_js_pre')
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
@stop
config/adminlte.php.@dump($menu) to inspect dynamic sidebar data.php artisan config:clear and php artisan view:clear if changes aren’t reflecting.Custom Components
Extend the package by creating new blade templates in resources/views/vendor/adminlte/ (e.g., box.custom.blade.php).
Hooks
Use sections like @section('adminlte_title_before') to inject content before/after default elements.
Configuration
Override defaults in config/adminlte.php:
'title' => 'MyApp Admin',
'logo' => '<b>MyApp</b>',
'skin' => 'skin-blue',
'menu' => [], // Global menu items
Authentication
Extend the AuthenticatesUsers trait in your LoginController to customize login logic while using AdminLTE’s auth views.
RTL Support Enable right-to-left layout:
config(['adminlte.rtl' => true]);
How can I help you explore Laravel packages today?