# Admin Theme
# Configuration
To configure the admin theme in Bagisto, follow these steps:
In the Bagisto root directory, navigate to the config folder and open the
themes.php
file. Look for the keysadmin-default
andadmin-themes
. The configuration will appear as follows:<?php return [ 'admin-default' => 'default', 'admin-themes' => [ 'default' => [ 'views_path' => 'resources/admin-themes/default/views', 'assets_path' => 'public/admin-themes/default/assets', 'name' => 'Default' ] ] ];
Key Description admin-default Sets the current theme for the admin area admin-themes Stores a list of available themes
# Creating a Theme
To create a new admin theme, follow these steps:
Add a new theme entry to the
admin-themes
array in thethemes.php
file:<?php return [ 'admin-default' => 'default', 'admin-themes' => [ 'default' => [ 'views_path' => 'resources/admin-themes/default/views', 'assets_path' => 'public/admin-themes/default/assets', 'name' => 'Default' ], 'theme1' => [ 'views_path' => 'resources/admin-themes/theme1/views', 'assets_path' => 'public/admin-themes/theme1/assets', 'name' => 'Theme 1' ] ] ];
In the new theme entry, specify the path to the views and assets folders according to your desired structure. For example:
Views structure:
- resources └── admin-themes └── theme1 └── views
Assets structure:
- public └── admin-themes └── theme1 └── assets
To replace the dashboard page with a custom version, create the same directory structure for the dashboard in the
theme1
folder as it exists in thedefault
folder. For example:- resources └── admin-themes └── theme1 └── views └── dashboard └── index.blade.php
In the newly created
index.blade.php
file, add the desired content for the dashboard page. For example:Theme 1 Sample
Finally, activate the new theme by changing the value of the
admin-default
key in theconfig/themes.php
file:'admin-default' => 'theme1',
Now, when you access the dashboard page in the admin area, you should see the customized version provided by the new theme (Theme 1).