Introduction
There are basically two types of configurations: 1. Configuration File and 2. Configuration Manager. Both has quite a same working except the User's Comfortableness towards GUI. Configuration Manager use the Database to store the data and focuses on UI related configurations.
Configuration File
This file is like any other standard laravel configuration file. This file is generated at the time of installation and stored into /config/laraadmin.php
. This file as two parts:
General Configurations
As of now general configuration stores only Admin Route Path /admin
. This is the url segment which you use to access Admin Panel.
'adminRoute' => 'admin',
You can access this setting via config('laraadmin.adminRoute')
where laraadmin
is configuration file name. To get complete url for admin panel you can use:
<a href="{{ url(config('laraadmin.adminRoute')) }}">Admin Panel</a>
Uploads Configurations
This configuration is for Uploads Manager to decide Uploads visibility and File name changes.
'uploads' => [
'private_uploads' => false,
'default_public' => false,
'allow_filename_change' => true
],
Check details about this in Upload Manager Docs.
Configuration Manager
You can open Configurations by Configure
Option shown in Top Navbar or by url /admin/la_configs
This is UI tool in LaraAdmin to configure various option in Admin Panel. It uses Database table la_configs
to store the data. This table is populated when we call php artisan db:seed
after migration.
Existing Configurations
Sitename | Complete Site name e.g. LaraAdmin 1.0 |
Sitename First Word | First word of Navbar Brand Text (AdminLTE) e.g. Lara |
Sitename Second Word | Second word of Navbar Brand Text (AdminLTE) e.g. Admin 1.0 |
Sitename Short | Short Sitename for Mini Sidebar Layout. Maximum 3 Characters |
Site Description | Site Description to put in HTML Meta Data + Default Homepage. |
Show Search Bar | Whether to show Search Form in Left Sidebar |
Show Messages Icon | Whether to Messages Section in Navbar |
Show Notifications Icon | Whether to show Notification Section in Navbar |
Show Tasks Icon | Whether to show Tasks Section in Navbar |
Show Right SideBar Icon | Whether to show Right SideBar Section in Navbar |
Skin Color | White Blue Black Purple Yellow Red Green |
Layout |
AdminLTE supports total 5 types of layouts.
|
Default Email Address | Default Email Address from which mails will be sent via smtp. Used for password forgot + Mailing Account creation notification. |
Using Configurations
You can access these saved configuration via Model LAConfigs
as below. Check database table for la_configs
more settings.
use Dwij\Laraadmin\Models\LAConfigs;
$sitename = LAConfigs::getByKey('sitename');
Adding Configurations
It is very easy to add new configurations on this page. We have included controller Controllers\LA\LAConfigController.php
and blade view views\la\la_configs\index.blade.php
which can be further customized to add new configuration.
Note: You need to add new row in your configuration table la_configs
if not exists. You can configure it in LAConfigController::store()
method.
Is this content useful ?