dgvai/laravel-adminlte-components
Laravel 7+ Blade components for AdminLTE 3 (Bootstrap) dashboards. Includes widgets (info/small boxes, cards, alerts, modals, datatables) and form inputs (date, file, color, switch, tags, sliders). Configurable and plugin-ready.
Installation
composer require dgvai/laravel-adminlte-components
Publish the package assets (Blade components, JS, CSS):
php artisan vendor:publish --provider="Dgvai\AdminLTEComponents\AdminLTEComponentsServiceProvider" --tag="public"
Basic Integration
Add the AdminLTE facade to your app/Providers/AppServiceProvider.php:
use Dgvai\AdminLTEComponents\Facades\AdminLTE;
public function boot()
{
AdminLTE::withConfig(path_to_your_config);
}
First Use Case Render a basic layout in a Blade view:
@extends('adminlte::page')
@section('title', 'Dashboard')
@section('content_header')
<h1>Dashboard</h1>
@stop
@section('content')
<p>Welcome to your AdminLTE dashboard!</p>
@stop
Layout Customization Override default AdminLTE sections via Blade:
@push('styles')
<link rel="stylesheet" href="/custom.css">
@endpush
Dynamic Sidebars
Use the sidebar component with dynamic menu items:
@component('adminlte::sidebar')
@slot('menu')
@include('partials.sidebar-menu')
@endslot
@endcomponent
Box Components Create reusable content boxes:
@component('adminlte::box')
@slot('header')
<h3 class="box-title">Box Title</h3>
@endslot
<p>Box content goes here.</p>
@endcomponent
Integration with Laravel Mix
Configure AdminLTE assets in webpack.mix.js:
mix.js('resources/js/adminlte.js', 'public/js')
.sass('resources/sass/adminlte.scss', 'public/css');
Dynamic Configs Pass runtime configs to AdminLTE:
AdminLTE::withConfig([
'template' => 'custom-template',
'skin' => 'skin-blue',
]);
Partial Overrides
Override specific components (e.g., navbar, footer) in resources/views/vendor/adminlte/.
Event Listeners
Hook into AdminLTE events (e.g., AdminLTE.Initialized) for post-render logic.
Asset Paths
public_path() is correctly configured if using custom asset paths.php artisan view:clear
Blade Component Conflicts
@adminlte::box vs @component('adminlte::box')).Deprecated Methods
AdminLTE::make(); newer versions favor Blade components.AdminLTE Version Mismatch
package.json and composer.json align:
"admin-lte": "^2.4.14"
Check Published Assets
Verify files exist in public/vendor/adminlte/ after publishing.
Blade Debugging
Use @dump to inspect component slots:
@dump($__env->yieldContent('title'))
CSS/JS Conflicts
Disable AdminLTE’s default assets in config/adminlte.php:
'assets' => [
'enabled' => false,
],
Custom Components
Extend the package by creating new Blade components in resources/views/vendor/adminlte/.
Config Overrides
Override defaults in config/adminlte.php:
'template' => 'custom-layout',
'skin' => 'skin-black',
JavaScript Hooks
Extend AdminLTE’s JS via resources/js/adminlte-extensions.js:
$.AdminLTE.extend({
customMethod: function() { /* ... */ }
});
How can I help you explore Laravel packages today?