Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Adminlte Bundle Laravel Package

kevinpapst/adminlte-bundle

Kevin Papst's AdminLTE Bundle integrates the AdminLTE admin theme into Symfony apps, offering ready-to-use layouts, menus, forms, widgets, and Bootstrap-based UI components for building responsive backend dashboards quickly.

View on GitHub
Deep Wiki
Context7

Getting Started

Framework reality check first: this is a Symfony bundle, not a Laravel package. There is no service provider, no config/adminlte.php, no Blade views. It ships Twig templates, a Symfony DI extension, and event-driven menu/notification hooks built around knpuniversity/KnpMenuBundle and optionally FOSUserBundle. For a Laravel codebase you have two realistic paths, and you should pick one deliberately before writing any code:

  1. Port the templates (recommended for Laravel). Pull Resources/views/layout/*.twig, convert to Blade, and drop the bundle entirely. You keep the AdminLTE 2 look, you lose the Symfony-only plumbing.
  2. Run it where it belongs — inside a Symfony 4/5 app (or a small Symfony sidecar for an admin panel). The bundle is only worth its weight there.

Minimal Symfony setup if you go route 2:

composer require kevinpapst/adminlte-bundle
// config/bundles.php
return [
    // ...
    KevinPapst\AdminLTEBundle\AdminLTEBundle::class => ['all' => true],
    Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true],
];
# config/packages/admin_lte.yaml
admin_lte:
    theme:
        title: 'My Admin'
        logo: 'build/images/logo.png'
        skin: 'skin-blue'
        boxed_layout: false
    routes:
        adminlte_login: 'app_login'
        adminlte_logout: 'app_logout'

Where to look first, in this order:

  • src/DependencyInjection/Configuration.php — the real API surface. Every theme knob (title, logo, skin, boxed_layout, route_prefix) is defined here. Read this before reading docs.
  • src/Resources/views/layout/ — default-layout.html.twig, base.html.twig, plus the navbar/sidebar/content partials. This is what you {% extends %} and what you override.
  • src/Event/ — the extension points (ThemeEvent, SidebarMenuEvent, NavbarMenuEvent, NotificationEvent, UserMenuEvent, breadcrumb events). Menus are not configured in YAML; they are built in listeners.
  • src/Resources/config/ — service wiring, which tells you what is autowired and what is optional.

First use case — a working dashboard page. Extend the layout and fill the blocks:

{# templates/dashboard/index.html.twig #}
{% extends '@AdminLTE/layout/default-layout.html.twig' %}

{% block page_title %}Dashboard{% endblock %}
{% block page_subtitle %}Overview{% endblock %}

{% block breadcrumb %}
    <ol class="breadcrumb">
        <li><a href="{{ path('dashboard') }}"><i class="fa fa-dashboard"></i> Home</a></li>
        <li class="active">Dashboard</li>
    </ol>
{% endblock %}

{% block main %}
    <div class="row">
        <div class="col-md-3">
            {% include '@AdminLTE/widget/box.html.twig' with {
                title: 'Users', value: userCount, icon: 'users', type: 'info'
            } %}
        </div>
    </div>
{% endblock %}

If that renders with the AdminLTE chrome, you have validated the whole stack: routing, Twig inheritance, asset loading, and the theme config.

Implementation Patterns

1. Layout inheritance with named blocks. Everything is built on Twig block overrides: page_title, page_subtitle, breadcrumb, main, content, stylesheets, javascripts, sidebar, navbar. Prefer overriding the narrowest block possible. Overriding content wholesale means you inherit nothing and will fight the bundle on every upgrade.

2. Template overriding via the Symfony bundle convention. Don't edit vendor/. Mirror the path under templates/bundles/AdminLTEBundle/layout/default-layout.html.twig and Symfony picks yours up automatically. This is the cleanest customization seam and survives composer update.

3. Menus are code, not config. Menus are built with KnpMenuBundle and passed to the bundle via events. The pattern is a listener that constructs a MenuBuilder, marks the active item, and returns it:

class SidebarMenuSubscriber implements EventSubscriberInterface
{
    public function onSidebarMenu(SidebarMenuEvent $event): void
    {
        $menu = $event->getMenu();
        $menu->addChild('dashboard', ['route' => 'dashboard'])
             ->setLabel('Dashboard')
             ->setExtra('icon', 'fa fa-dashboard');

        $menu->addChild('users', ['route' => 'user_index'])
             ->setExtra('icon', 'fa fa-users');

        $event->setMenu($menu);
    }

    public static function getSubscribedEvents(): array
    {
        return [AdminLTEEvent::SIDEBAR_MENU => 'onSidebarMenu'];
    }
}

The same shape applies to NAVBAR_MENU, USER_MENU, BREADCRUMB_MENU, and NOTIFICATION_LIST. Active-state resolution and child visibility are handled by KnpMenu voters, so use route parameters rather than hand-rolling request()->getPathInfo() checks.

4. ThemeEvent for request-scoped chrome. Logo, title, and per-request theme tweaks come through ThemeEvent. This is the right place for a tenant-aware logo, or a title that includes the current organization — not the static YAML config.

5. Notifications and tasks as event-driven widgets. The bell/task dropdowns are populated by listeners returning arrays of DTOs. This is the pattern to copy in Laravel: a View::composer('layouts.partials.navbar', ...) that pushes a $notifications collection into the view — same separation of concerns, different mechanism.

6. FOSUserBundle integration is optional and dated. The bundle can wire login/logout routes and a user menu, but FOSUserBundle is itself abandoned. If you need auth, use Symfony's native security.yaml with a custom authenticator, and only use the bundle's user menu event for display.

7. Assets via Webpack Encore. The layout expects encore_entry_link_tags() / encore_entry_script_tags() for the configured entry names. Your webpack.config.js must expose entries matching what the bundle expects (AdminLTE CSS, jQuery, Bootstrap 3, admin-lte plugin JS). Adding a plugin means adding a new Encore entry and a new block entry in your child template's stylesheets/javascripts.

8. Laravel translation of the pattern. When porting to Blade, keep the same decomposition to minimize friction: layouts/adminlte.blade.php with @yield/@section, partials/navbar.blade.php, partials/sidebar.blade.php, a Menu service class bound as a singleton, and View::composer for notifications. Route-level concerns map to middleware (auth, custom can:admin), and the admin_lte config tree maps to a config/adminlte.php array with theme, menu, and routes keys.

9. Reusable widgets. The bundle ships box/info-box/small-box partials. Define one Blade component or Twig include per widget and pass primitives (title, value, icon, type, progress). Resist the urge to fork the partial for one-off layouts.

Gotchas and Tips

  • Archived since 2021, and it shows. AdminLTE 2 is Bootstrap 3 + jQuery. No security patches, no PHP 8.2+ guarantees, no Bootstrap 5. Treat it as a legacy UI kit, not a living dependency. Pinning is mandatory; expect to vendor-lock or fork.
  • License is NOASSERTION on Packagist. The bundle's own license file is the only authority; AdminLTE 2 upstream is MIT, but the bundle's terms must be verified manually before shipping. Do not assume MIT just because the theme is.
  • Twig is not Blade-compatible. Any porting effort is a real rewrite, not a find-and-replace. {% block %} → @section, {{ path() }} → {{ route() }}, {% include with %} → @include + @php/component props. Budget for it; a naive port produces escaping and auto-refresh bugs.
  • Menus won't appear if the listener isn't registered. In Symfony 4+, listeners must be tagged kernel.event_subscriber (autoconfigure handles it) or explicitly registered. Silent no-op menus are almost always a container wiring problem — check bin/console debug:event-dispatcher for the event id.
  • Config changes require a cache clear. admin_lte is compiled into the container. Editing admin_lte.yaml without bin/console cache:clear produces "why is my title still the old one" confusion. Same for Twig template overrides in prod (cache:clear or twig cache warm).
  • Asset 404s are an Encore entry mismatch. If the sidebar renders unstyled, the encore_entry_link_tags('adminlte') name doesn't match webpack.config.js's addEntry. Verify with bin/console debug:twig and by inspecting the built public/build/manifest.json.
  • Route names must exist at compile time. admin_lte.routes.adminlte_login pointing at a nonexistent route blows up on page render (or on cache warm), not at boot. Grep your config/routes.yaml before blaming the bundle.
  • FOSUserBundle coupling is the sharpest edge. It is abandoned, its templates conflict with modern Symfony security, and the bundle's user menu assumes its data shape. Disable the integration and supply your own USER_MENU listener rather than fighting it.
  • Breadcrumbs are opt-in per template. There is no automatic generation from the route hierarchy. If breadcrumbs are empty, you didn't override the breadcrumb block — that's expected, not a bug.
  • Extension points worth knowing: ThemeEvent (per-request chrome), SidebarMenuEvent/NavbarMenuEvent (navigation), NotificationEvent (bell dropdown), UserMenuEvent (avatar dropdown), and template overrides under templates/bundles/AdminLTEBundle/. That set covers ~95% of real customization; anything else means forking.
  • Debugging toolkit: bin/console debug:event-dispatcher, bin/console lint:twig templates/, and the Symfony profiler's Twig panel (which shows exactly which template file won, bundle vs. local override). The profiler is faster than reading the docs.
  • For Laravel teams, the honest recommendation: don't bridge this. Use jeroennoten/Laravel-AdminLTE for AdminLTE 3 in Blade, or filament/filament / orchid/platform if you want a maintained admin layer. This bundle is worth using only in an existing Symfony app that already has AdminLTE 2 in production and needs a cheap lift-and-shift, and even then only long enough to plan the migration off it.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle