maxyc/laravel-adminlte-components
Installation:
composer require maxyc/laravel-adminlte-components
Publish the package's assets (optional, for customization):
php artisan vendor:publish --provider="Maxyc\AdminLteComponents\AdminLteComponentsServiceProvider"
First Use Case:
Include the base layout in your resources/views/layouts/app.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
@section('css')
<!-- Add custom CSS here -->
@stop
@section('js')
<!-- Add custom JS here -->
@stop
Key Files:
resources/views/vendor/adminlte/ for all available components.page.blade.php (base layout) and partials/ (reusable sections like sidebar, navbar).Layout Structure:
@extends('adminlte::page') as the root template.@section('title'), @section('content_header'), etc.@section('sidebar')) to customize the sidebar.Reusable Components:
@component('adminlte::box').
@component('adminlte::box', ['title' => 'Quick Example'])
<p>Box content here.</p>
@endcomponent
@component('adminlte::widget') for smaller, interactive elements.@component('adminlte::form') with built-in validation helpers.Dynamic Content:
@component('adminlte::box', [
'title' => 'Dynamic Title',
'icon' => 'fa fa-cog',
'bodyClass' => 'bg-gray-light'
])
@slot('footer') for component-specific footers (e.g., in boxes).Integration with Laravel:
@auth directives with AdminLTE’s built-in auth components (e.g., @component('adminlte::auth.login')).@component('adminlte::box', ['title' => $post->title])
{{ $post->body }}
@endcomponent
Theming:
config/adminlte.php):
'skin' => 'blue', // Options: 'skin-blue', 'skin-black', etc.
'sidebarCollapse' => true,
@section('css') and @section('js') in your layout.Component Naming:
adminlte::box vs. adminlte::Box).Asset Loading:
@section('html_header')
@include('adminlte::partials.head-top')
@stop
Laravel 8+ Compatibility:
AppServiceProvider:
public function boot()
{
$this->loadViewsFrom(__DIR__.'/../vendor/adminlte', 'adminlte');
}
Dynamic Sidebars:
@section('sidebar'):
@section('sidebar')
@include('adminlte::partials.sidebar', ['menuItems' => $menuItems])
@stop
Missing Components:
vendor/maxyc/adminlte-components/resources/views/.@component directive.Styling Issues:
.skin-* classes in your custom CSS.Configuration Overrides:
config/adminlte.php) takes precedence over defaults. Clear cached config after changes:
php artisan config:clear
Custom Components:
vendor/ to resources/views/vendor/adminlte/ and modifying.Plugin Integration:
spatie/laravel-permission by extending the sidebar:
@section('sidebar')
@include('adminlte::partials.sidebar')
@include('adminlte::partials.sidebar-menu', ['permissions' => auth()->user()->getAllPermissions()])
@stop
Localization:
php artisan vendor:publish --tag=adminlte-lang
How can I help you explore Laravel packages today?