backpack/base
Backpack for Laravel is a flexible admin panel framework that lets you build custom CRUD interfaces, dashboards, and admin areas quickly. It provides reusable field types, filters, widgets, and permissions on top of Laravel, with extensive docs and a large community.
Read this first: backpack/base is archived and superseded. As of Backpack v4, admin auth and the AdminLTE shell are built into backpack/crud and no longer live here. Treat this package as a legacy maintenance concern only — new projects should install backpack/crud and skip this entirely.
For a v3-era app that still depends on it:
composer require backpack/base — pin to a v3-compatible tag. It targets Laravel 5.x and will not boot on Laravel 9+.php artisan vendor:publish --provider="Backpack\Base\BaseServiceProvider"
This gives you config/backpack/base.php, the AdminLTE views, lang files, and public assets under public/vendor/backpack/base.config/auth.php. Base expects a backpack guard backed by an App\User provider, or a BackpackUser model — check config/backpack/base.php for guard, user_model, and user_admin_attribute.routes/backpack/base.php — it registers /admin/login, /admin/logout, /admin/register, /admin/dashboard, and the /admin redirect. Everything routes through config('backpack.base.route_prefix').First use case: get a logged-in admin landing on a dashboard. Hit /admin, get redirected to /admin/login, authenticate, and see the AdminLTE dashboard. If that works end-to-end, the base layer is wired correctly and you can layer CRUD controllers on top.
Guard + user model. The canonical setup is a dedicated backpack guard, a BackpackUser model (or your App\User), and an is_admin-style column used by the middleware to decide whether the user may proceed. Keep the admin check in config (user_admin_attribute) rather than hardcoding a column name — you'll thank yourself during upgrades.
Controller extension. Base ships AdminController, Auth\LoginController, Auth\RegisterController, Auth\ForgotPasswordController, Auth\ResetPasswordController, and MyAccountController. Override by extending, not by editing vendor code:
namespace App\Http\Controllers\Admin;
use Backpack\Base\app\Http\Controllers\AdminController;
class DashboardController extends AdminController
{
public function dashboard()
{
$this->data['title'] = 'Operations';
return view('admin.dashboard', $this->data);
}
}
Then point route_prefix/the route group at your controller.
View overrides. Publish selectively. The package registers a backpack view namespace, so a file at resources/views/vendor/backpack/base/layouts/default.blade.php shadows the package one. Publish only the files you actually touch — a full re-publish freezes you to a 2018 snapshot with no upstream fixes to rebase against.
Composing with backpack/crud. In v3, CRUD provided the panels and Base provided the chrome and auth. Both register under the same route prefix, so ordering matters: Base's service provider must register its auth and catch-all routes before CRUD's resource routes. If you get a 404 on /admin/dashboard or a login loop after adding a CRUD, check provider order in config/app.php first.
Layout/menu customization. The sidebar is a plain Blade partial. Either override layouts/inc/sidebar.blade.php or, better, define menu items in a config array and loop over them in an overridden partial — that keeps menu content out of templates in a version you can't upgrade.
Password reset and mail. Reset templates and the mail view are config keys under backpack.base.*. Override the notification/view rather than editing the published blade, since you may want to swap in your own Mailable for branding and deliverability.
Upgrade path. The practical pattern for teams still here: freeze the legacy admin, and migrate incrementally. Backpack v4's backpack/crud provides equivalent auth middleware, a backpack_user() helper, and a backpack guard config — map your is_admin column to user_admin_attribute in the new config and most of your access logic carries over untouched.
NOASSERTION. The repo carries an MIT-style LICENSE file but the composer metadata doesn't declare it. Confirm the LICENSE text before redistributing or vendoring.user_admin_attribute check returns a redirect, not an exception. If a valid login bounces back to /admin/login, verify the column exists on the model and is truthy — a 0/null mismatch is the usual culprit. Add temporary logging in the middleware to confirm.StartSession, ShareErrorsFromSession, or VerifyCsrfToken in the admin route group produces login loops and 419s that look like credential problems. Diff your group against the package's default.route_prefix run php artisan route:clear. Use php artisan route:list | grep admin to see what's actually registered, not what you think is.public/vendor/backpack/base. If public/vendor is gitignored, your build pipeline must re-run the publish step or the admin looks unstyled in production only.BaseServiceProvider (registerRoutes, registerMiddleware), the backpack.base.* config tree, and the MyAccountController for profile edits. Anything else, assume it's unsupported and fork locally if you must.storage/logs/laravel.log → route:list → confirm guard in config/auth.php → confirm user_admin_attribute on the model → confirm views resolve to vendor/backpack/base/... and not stale published copies.How can I help you explore Laravel packages today?