Skip to content

Configuration

Terminal window
php artisan vendor:publish --tag=lte3-config

The file is config/lte3.php. Without publishing, the package defaults apply.

KeyDefaultDescription
logo'<b>Admin</b>LTE'HTML of the brand in the sidebar and on the auth pages
dashboard_slug'lte3'Path of the dashboard home: the brand link goes to url(dashboard_slug)
routestrueRegister the demo routes under /lte3. They are never registered in production
middleware['web', LteRequestOptions::class]Middleware of the demo routes only
KeyDefaultDescription
view.theme'system'Initial color theme: light, dark or system (follows the OS). The theme switcher in the navbar keeps the user’s choice in localStorage (lte3-theme), which overrides this value
view.preloaderfalseShow the AdminLTE preloader while the page loads
view.compacttrueCompact navbar and sidebar: text-sm on the header and brand, nav-compact on the sidebar menu
view.pattern_validation.validate_on_loadfalseAlso check prefilled values of fields with pattern on page load. See Pattern validation
view.pattern_validation.message'Format is not valid.'Default error text of a field with pattern
view.alerts['toastr']How flash messages and validation errors are shown: any of toastr, sweetalert, bootstrap. See Layout
view.sidebar.searchtrueSearch input above the sidebar menu
view.sidebar.authfalseUser panel at the top of the sidebar (only for a logged in user)
view.componentssee belowField components: Blade view, positional arguments, default attributes
view.field_attrssee belowAttribute names printed as HTML attributes of the field
view.next_destination_key'_destination'Name of the “redirect after the action” parameter. See Back URL, modals and options
view.modal_key'_modal'Name of the “open this modal after the redirect” parameter
view.pagination.view'pagination::bootstrap-5'View of Lte3::pagination() for paginate()
view.pagination.simple_view'pagination::simple-bootstrap-5'View for simplePaginate() and cursorPaginate()
view.media.format'legacy'Request format of mediaFile: legacy or expand. The field attribute format overrides it
view.media.thumb_size110Minimal width in px of an image tile in mediaImage and lfmImage. The field attribute thumb_size overrides it
view.media.thumb.driver'conversion'How mediaFile gets thumbnail URLs: conversion, imagepreset or a callable. See Media thumbnails
view.media.thumb.conversion_name'thumb'Media Library conversion for the conversion driver
view.media.thumb.imagepreset_params['w' => 100, 'h' => 100, 'fit' => 'crop']Parameters for the imagepreset driver
view.lfm.thumbnullThumbnail of lfmImage: null (the image itself), 'imagepreset' or an invokable class name

Every Lte3::<name>(...) call is looked up here:

'select2' => [
'blade' => 'lte3::components.select2',
'vars' => ['name', 'selected', 'options', 'attrs'],
],
'number' => [
'blade' => 'lte3::components.text',
'vars' => ['name', 'value', 'attrs'],
'default' => ['type' => 'number', 'default' => 0],
],
  • blade — the view to render
  • vars — names of the positional arguments, in order. Lte3::select2('status', 'new', $options, ['label' => 'Status']) passes $name, $selected, $options and $attrs to the view
  • default — attributes merged under the ones passed in the call

Several entries share one view with different defaults: text, number, email, url, search, secret, password all render components.text; lfmImage is lfmFile with is_image; mediaImage is mediaFile with is_image and accept => 'image/*'.

Change the defaults of a field for the whole project:

'textarea' => ['blade' => 'lte3::components.textarea', 'vars' => ['name', 'value', 'attrs'], 'default' => ['rows' => 5]],

Point a field to your own view, or add a new component — it becomes available as Lte3::rating(...) at once:

'rating' => ['blade' => 'admin.fields.rating', 'vars' => ['name', 'value', 'attrs'], 'default' => ['max' => 5]],

Details on how the view receives the value and attributes: Fields overview.

timepicker and datetimepicker take the default timezone from env('APP_TIMEZONE_CLIENT', 'Europe/Kyiv'). With config:cache the value is read when the cache is built.

Attribute names a component prints as HTML attributes of the input when they are passed in $attrs:

'field_attrs' => [
'autocomplete', 'autofocus', 'accept', 'placeholder', 'required', 'maxlength', 'minlength',
'pattern', 'max', 'min', 'step', 'rows', 'title', 'alt', 'style', 'id', 'data-name', 'x-model',
],

Add a name to pass another attribute through, e.g. 'inputmode' or an Alpine directive. An attribute set to false or null is not rendered at all ('required' => false does not make the field required); 0 and '' are rendered.