Configurations
Learn all about the Laravel Admin Panel configs
With the installation of admin panel you will have a new configuration file located at config/admin.php
In this file you can find various options to change the configuration of your admin panel installation. Following is a more detailed description of each of the configuration sets:
User Config
'user' => [
'add_default_role_on_register' => true,
'default_role' => 'user',
'admin_permission' => 'browse_admin',
'namespace' => App\User::class,
],
add_default_role_on_register: Specify whether you would like to add the default role to any new user that is created.
default_role: You can also specify what the default_role is of the user.
admin_permission: The permission needed to view the admin dashboard.
namespace: The namespace of your apps User Class.
Controller Config
'controllers' => [
'namespace' => ''LaravelAdminPanel\\Http\\Controllers',
],
You can specify the default controller namespace of admin.
If you do only wish to overwrite a single controller, you might consider adding the following piece of code in your
AppServiceProvider
'sregister
-method:$this->app->bind(CrudController::class, MyController::class);
#### Model Config
'models' => [
//'namespace' => 'App\',
],
You can specify the namespace or location of your models. If not defined the default application namespace will be used.
#### Asset Config
'assets_path' => '/vendor/laraveladminpanel/admin/assets',
> Note: When upgrading to new version of admin panel the assets located in the /vendor/laraveladminpanel/admin/assets directory may need to be overwritten, so if you wish to customize any styles you will want to duplicate that directory and specify the new location of your asset_path.
#### Storage Config
'storage' => [
'disk' => 'public',
],
By default admin panel is going to use the `public` local storage. You can additionally use any driver inside of your `config/filesystems.php`. This means you can use s3, google cloud storage, or any other file storage system you would like.
#### Database Config
'database' => [
'tables' => [
'hidden' => ['migrations', 'data_rows', 'data_types', 'menu_items', 'password_resets', 'permission_role', 'settings'],
],
],
You can to hide some database tables.
#### Prefix Config
'prefix' => 'admin',
In this config you can specify an alternate prefix for visiting admin panel. Instead of visiting `/admin` perhaps you want to visit `/backend` to visit the laravel admin panel.
#### Multilingual Config
'multilingual' => [
'enabled' => false,
'default' => 'en',
'locales' => [
'en',
//'ru',
],
],
You can specify whether or not you want to **enable** mutliple languages. You can then specify your **default** language and all the support languages (**locales**)
#### Dashboard Config
'dashboard' => [
'navbar_items' => [
'Profile' => [
'route' => 'admin.profile',
'classes' => 'class-full-of-rum',
'icon_class' => 'admin-person',
],
'Home' => [
'route' => '/',
'icon_class' => 'admin-home',
'target_blank' => true,
],
'Logout' => [
'route' => 'admin.logout',
'icon_class' => 'admin-power',
],
],
'widgets' => [
'LaravelAdminPanel\\Widgets\\UserDimmer',
'LaravelAdminPanel\\Widgets\\PostDimmer',
'LaravelAdminPanel\\Widgets\\PageDimmer',
],
],
In the dashboard config you can add **navbar_items**, make the **data_tables** responsive, and manage your dashboard **widgets**.
**navbar_items**
Include a new route in the main user navbar dropdown by including a 'route', 'icon_class', and 'target_blank'.
**data_tables**
If you set 'responsive' to true the datatables will be responsive.
**widgets**
Here you can manage the widgets that live on your dashboard. You can take a look at an example widget class by viewing the current widgets inside of `laraveladminpanel/admin/src/Widgets`.
#### Primary Color Config
'primary_color' => '#22A7F0',
The default primary color for the admin panel is a light blue color. You can change that primary color.
#### Show Dev Tips Config
'show_dev_tips' => true,
In the Laravel Admin Panel there are dev tips that will show you how to reference certain values from admin panel. You can choose to hide these tips by setting this configuration to false.
#### Additional CSS Config
'additional_css' => [
//'css/custom.css',
],
This is super cool, you can add your own custom stylesheets.
#### Additional JS Config
'additional_js' => [
//'js/custom.js',
],
You can add your own javascript that will be executed in the Laravel Admin Panel. Add as many js files as needed.
#### Google Maps Config
'googlemaps' => [
'key' => env('GOOGLE_MAPS_KEY', ''),
'center' => [
'lat' => env('GOOGLE_MAPS_DEFAULT_CENTER_LAT', '32.715738'),
'lng' => env('GOOGLE_MAPS_DEFAULT_CENTER_LNG', '-117.161084'),
],
'zoom' => env('GOOGLE_MAPS_DEFAULT_ZOOM', 11),
],
There is a new data type called **coordinates** that allow you to add a google map as a datatype. The user can then drag and drop a pin in the google map to save a longitude and latitude value in the database.
In this config you can set the default Google Maps Keys and center location. This call also be added to your .env file.
Updated less than a minute ago