Installation
Requirements
Section titled “Requirements”- PHP ^8.0
- Laravel 9 – 13
almasaeed2010/adminlte^3.2 — the AdminLTE 3 CSS, JS and plugins the layout loads frompublic/vendor/adminlte
Optional, for specific fields:
fomvasss/laravel-medialibrary-extension— server side of the mediaFile fieldunisharp/laravel-filemanager— the lfmFile field and the file picker of the editorsfomvasss/laravel-imagepresets^1.16 — theimagepresetdriver of media thumbnails
Install
Section titled “Install”composer require fomvasss/laravel-lte3composer require almasaeed2010/adminlteThe service provider and the Lte3 alias are registered by package discovery.
The layout expects the assets at fixed public paths:
| Path | Content |
|---|---|
public/vendor/adminlte/dist | AdminLTE CSS, JS, images (from vendor/almasaeed2010/adminlte/dist) |
public/vendor/adminlte/plugins | jQuery, Bootstrap, select2, toastr, moment and other plugins (from vendor/almasaeed2010/adminlte/plugins) |
public/vendor/lte3 | the package’s main.js, main.css, mb-blocks.js, extra plugins and images (from vendor/fomvasss/laravel-lte3/public) |
Choose one of the ways below to put them there.
lte3:install — a starter panel in the project
Section titled “lte3:install — a starter panel in the project”php artisan vendor:publish --tag=lte3-config # optionalphp artisan lte3:installThe command asks for the dashboard slug (default admin) and then:
- copies (or symlinks, on request) the AdminLTE
distandpluginsintopublic/vendor/adminlte - copies the views
auth,examples,layoutsandpartsintoresources/views/<slug>and rewrites'lte3::references in them to'<slug>., so the copies are yours to edit - publishes the package assets (
lte3-assets) intopublic/vendor/lte3 - creates
routes/<slug>.phpwithRoute::view('<slug>', '<slug>.examples.home')and appendsrequire __DIR__ . '/<slug>.php';toroutes/web.php - runs
storage:linkifpublic/storagedoes not exist
The field components are not copied: Lte3::text() and the others keep rendering lte3::components.* from the package. Details: Artisan commands.
Symlinks — assets follow composer update
Section titled “Symlinks — assets follow composer update”To use the package layouts as they are (@extends('lte3::layouts.app')) and get asset updates with Composer, link the three directories:
php artisan lte3:linklte3:link creates absolute symlinks, which break when the project directory is moved or deployed to another path. Relative links survive both:
mkdir -p public/vendor/adminlteln -s ../../../vendor/almasaeed2010/adminlte/dist public/vendor/adminlte/distln -s ../../../vendor/almasaeed2010/adminlte/plugins public/vendor/adminlte/pluginsln -s ../../vendor/fomvasss/laravel-lte3/public public/vendor/lte3With symlinks almasaeed2010/adminlte must be a regular (not --dev) dependency, otherwise composer install --no-dev on production leaves the links dangling.
Middleware
Section titled “Middleware”LteRequestOptions remembers the last URL of index pages for the “back” button, opens a modal after a redirect and stores a few UI options in the session — see Back URL, modals and options. Add it to the routes of the panel.
Laravel 11 and later, bootstrap/app.php:
->withMiddleware(function (Middleware $middleware) { $middleware->web(append: [ \Fomvasss\Lte3\Http\Middleware\LteRequestOptions::class, ]);})Laravel 9 and 10, app/Http/Kernel.php:
protected $middlewareGroups = [ 'web' => [ // ... \Fomvasss\Lte3\Http\Middleware\LteRequestOptions::class, ],];Or only on the admin group:
Route::middleware(['web', 'auth', \Fomvasss\Lte3\Http\Middleware\LteRequestOptions::class]) ->prefix('admin') ->group(base_path('routes/admin.php'));The middleware key of the config applies only to the demo routes of the package.
Demo pages
Section titled “Demo pages”Outside of the production environment and while routes in the config is true, the package registers demo routes under /lte3:
| URL | Page |
|---|---|
/lte3, /lte3/2, /lte3/3 | dashboards |
/lte3/components | all fields and components |
/lte3/mb-blocks | block repeaters |
/lte3/blank | an empty page |
/lte3/login, /lte3/register, /lte3/forgot-password, /lte3/reset-password | auth pages |
The demo routes have no authentication, and the demo endpoint /lte3/data/save writes request values into the session under a key taken from the request.
Translations
Section titled “Translations”Texts of the newer field UIs (media and lfm fields) go through __() with English keys. To translate them, add the keys to lang/<locale>.json of the project; the lists are on the mediaFile and lfmFile pages.
Next steps
Section titled “Next steps”- Configuration
- Layout and pages — build the first page
- Forms