Skip to content

Laravel LTE3

An admin panel for Laravel built on AdminLTE 3 (Bootstrap 4, jQuery): a ready layout with navbar, sidebar, alerts and auth pages, and a Blade form builder with almost forty components — from text inputs to select2 with AJAX search, date pickers, file managers, Spatie Media Library uploads, trees and inline editing.

Components

  • Fields in one line — {!! Lte3::text('title') !!} renders a Bootstrap form group with label, value, validation error and help text
  • Value from everywhere — old() input, the request, an explicit value, the bound form model or a default, in this order
  • AJAX out of the box — autosave of select2, checkbox, colorpicker and x-editable, AJAX search and tags, tree selects, modals filled from the server
  • Files — plain uploads, Laravel File Manager picker with drag and drop, Spatie Media Library field with previews, sorting, properties and a main file
  • Dynamic content — fields in modals, repeaters and AJAX responses are initialized automatically
  • Layout — light, dark and system theme, compact mode, filters, content header with breadcrumbs, toastr / sweetalert / Bootstrap alerts, pagination
  • Customizable — every field is a Blade view: publish it, or register your own component in the config
Terminal window
composer require fomvasss/laravel-lte3
composer require almasaeed2010/adminlte
php artisan lte3:install

A page of the panel:

@extends('lte3::layouts.app')
@section('content')
@include('lte3::parts.content-header', ['page_title' => 'Edit post'])
<section class="content">
<div class="card">
<div class="card-body">
{!! Lte3::formOpen(['action' => route('admin.posts.update', $post), 'method' => 'PUT', 'model' => $post]) !!}
{!! Lte3::text('title', null, ['required' => true]) !!}
{!! Lte3::select2('status', null, ['draft' => 'Draft', 'published' => 'Published']) !!}
{!! Lte3::datetimepicker('published_at') !!}
{!! Lte3::textarea('body', null, ['rows' => 8]) !!}
{!! Lte3::btnSubmit('Save') !!}
{!! Lte3::formClose() !!}
</div>
</div>
</section>
@endsection

title, status, published_at and body are filled from $post, and after a failed validation — from the old input.

Outside of production the package registers a demo at /lte3: dashboards, auth pages, all components at /lte3/components and block repeaters at /lte3/mb-blocks. Its source, resources/views/examples/components.blade.php, is the most complete set of usage examples.

Getting started

  1. Installation
  2. Configuration

Usage

  1. Layout and pages
  2. Forms
  3. Back URL, modals and options
  4. Actions and AJAX
  5. Dynamic content
  6. Pattern validation
  7. Block repeater (mb-blocks)
  8. Editors and file manager
  9. Media thumbnails

Fields

  1. Overview
  2. Inputs: text, number, email, url, search, password, secret, textarea, slug, hidden, colorpicker, range
  3. Choice: checkbox, checkboxes, radiogroup, select2
  4. Trees: select2Tree, treeview, nestedset
  5. Dates: datepicker, timepicker, datetimepicker, multidatespicker
  6. Files: file, fileForm, lfmFile, lfmImage, mediaFile, mediaImage
  7. Lists and tables: links, lists, tableOptions, xEditable
  8. Form and buttons: form, link, btnSubmit, btnReset, btnModalClose

Reference

  1. Lte3 facade
  2. Helpers
  3. JavaScript API
  4. Views and publishing
  5. Artisan commands
  6. Upgrading