# Configuration

You can find the main configuration file in `config/hotcoffee.php` after installation. It contains various options to configure the admin panel. Additionally you can publish a few more configuration files to help you with changing/extending some of the modules. More about that bellow.

{% hint style="info" %}
Always run`php artisan config:clear`after you changed something to rebuild the configuration cache.
{% endhint %}

### Admin Panel Prefix

Define the URL prefix for the admin panel. Another option will be to add `ADMIN_PREFIX` variable in the `.env` file.

```php
'prefix'    => env('ADMIN_PREFIX', '/admin'),
```

### Custom Logo

Want to use your own logo in the admin panel? Just define a path to the new image. If null the default logo image will be used.

```php
'custom_logo_url'  => null,
```

### Start Route

Name of the route where the admin users are redirected to after they login.

```php
'home_route'   => 'hotcoffee.admin.dashboard',
```

### Additional Resources

You can add custom style sheets and scripts that will be included in the hotCoffee admin panel. The resources should be placed in the "public" folder.

```php
'additional_css' => [
		//'css/admin/custom.css',
],

'additional_js' => [
		//'js/admin/custom.js',
],
```

### Model Languages / Translations

All the languages your app is going to use, or otherwise said, the languages (locales) your models are going to be tranlsated to. hotCoffee will automatically create translatable fields in the templates for each language. By default the InfoPage, MenuItem and Article models are translatable.&#x20;

To make your models translatable they should use the `Spatie\Translatable\HasTranslations` trait. You also need to define which of the properties are translatable `public $translatable = ['title', 'content'];`. When creating the template you can use the helper method `{!! language_fields($fields) !!}` to automatically generate the HTML fields for each language. You can read more about this in the [Helper Methods](helper-methods) section. Also check [https://github.com/spatie/laravel-translatable](https://github.com/spatie/laravel-translatable) for the extended documentation about translating models.

If you don't need multiple language support leave only the locale your app is going to use. The first language in the array is going to be the default one.

Flag icons are loaded from `public/vendor/hotcoffee/img/flags` so if the acranym is **'en'** the loaded image will be `en.svg` from that directory.&#x20;

```php
// 'acronym' => 'full name'

'languages' => [
		'en'    => 'English',
		'bg'    => 'Български [Bulgarian]',
],
```

### Admin Languages

At this time hotCoffee comes with English and Bulgarian translations for it's admin zone interface. You can comment out the ones you don't need from the array. The first language in the array is going to be the default one.  Instead of changing the package’s core files, you may override them by placing files in the `resources/lang/vendor/hotcoffee/{locale}` directory. If more than one locale is defined in the array admin users will be able to switch between the languages from the top menu.

<div align="left"><img src="https://582218703-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0JvlXkNR9xWhK_ij0j%2F-M28Iet9KILHGkT3PsaB%2F-M28Oeo_Ubw8g_KYlxGB%2Flanguages_top.png?alt=media&#x26;token=428aeaee-ebc9-43b4-9fe8-c537a7bc2fdd" alt=""></div>

Flag icons are loaded from `public/vendor/hotcoffee/img/flags` so if the acranym is **'en'** the loaded image will be `en.svg` from that directory.&#x20;

```php
'admin_languages' => [
		'en'    => 'English',
		'bg'    => 'Български [Bulgarian]'
],
```

### Auth History

If enabled this will keep a record of admin user logins. You can also specify how many recent logs to display in dashboard.

```php
'auth_log'          => true,
'auth_log_count'    => 10,
```

### Admin Navigation

You can add or remove elements from the admin navigation (right sidebar) in the `nav` array.

* **name**\
  The name (text of the menu element) can either be a string, or a key of a translation string.\
  `'name' => 'file.key'` or `'name' => 'Simple String'`.
* **route**\
  The name of the route where users will be redirected after clicking.
* **views**\
  The menu item will have a class of "active" whenever one of the given views is loaded.
* **hr**\
  If `'hr' => true` a horizontal line (divider) will be added after the menu item.
* **params**\
  Any additional parameters to the route name. For example if you want to link to a specific user page you can do this:\
  `'route'  => 'hotcoffee.admin.users.edit',`\
  `'params' => 2`\
  This is basically equal to `route('hotcoffee.admin.user.edit', 2);` and it will populate the `ahref` attribute with `ahref="https://yourapp.com/admin/users/2"`.
* **icon**\
  You can use font awesome icons or nucleo icons. \
  Either "`ni ni-{icon_name}`" or "`fa fa-{icon_name}`" . \
  Check these urls: [https://fontawesome.com/icons?d=gallery\&m=free](https://fontawesome.com/icons?d=gallery\&m=free) \
  [https://demos.creative-tim.com/argon-dashboard/docs/foundation/icons.html](https://demos.creative-tim.com/argon-dashboard/docs/foundation/icons.html)
* **color**\
  Color for the icon. Example: `'color' => 'yellow'`.

```php
'nav' => [

		'dashboard' => [ // Link o dashboard
			'name'  => 'Dashboard', 
			'route' => 'admin.dashboard',
			'params' => null,
			'views' => ['admin.dashboard'],
			'icon'  => 'ni ni-tv-2'
			'hr'		=> true,
			'color' => 'red'
		],
		
...
```

### Secondary Menu

<div align="left"><img src="https://582218703-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0JvlXkNR9xWhK_ij0j%2F-M28vhxmpwhGmfgQmmuY%2F-M28wBJIIY4KOgD6fPMk%2Fsec_menu.png?alt=media&#x26;token=1c383c35-ffa6-47bf-b679-8597dd2c7db3" alt=""></div>

You can have additional links in your secondary menu. However if you feel like you don't really need it you can hide it.

```php
'ui_secondary_menu' => false, // Will hide the secondary menu
```

You can swap the icon.

```php
'secondary_menu_icon'   => 'ni ni-settings-gear-65',
```

The `secondary_menu` array contains all the menu items. Each item should be defined as an associative array:

```php
'secondary_menu' => [
		
	'users' => [ // Menu item for users page
		'name'      => 'hotcoffee::admin.users', // element text
		'route'     => 'hotcoffee.admin.users.index', // route name
	],
		
	'roles' => [ // Menu item for roles page
		'name'      => 'hotcoffee::admin.user_roles', // element text
		'route'     => 'hotcoffee.admin.roles.index', // route name
		'divider'		=> true, // adds a divider (<hr/>) after the element
	],
	
...
```

### Disabled Controllers

Some times you might want to disable access to some controllers if you don't plan  to use them or if you don't want your client to have access to sensitive settings or some more advanced features (like adding or editing user roles). It's also recommended that you remove any links to the disabled controllers from the navigation.

```php
'disabled_controllers' => [
		'TaffoVelikoff\HotCoffee\Http\Controllers\Admin\RoleController',
		'TaffoVelikoff\HotCoffee\Http\Controllers\Admin\FlushController'
],
```

In the example above the `RoleController` and `FlushController` are disabled. Meaning if somebody tries to reach any it's methods/routes they will be redirected back with an error message "access denied". Of course you can also overwrite all the routes for those controllers or overwrite the controllers themselves, but "disabling" them is a faster solution.

### TinyMCE Integration

This is where you can configure the TinyMCE integration. You can add more plugins, icons to the context menu and toolbars. You can also disable the File Manager integration if you prefer to. For all possible variables and functions, please refer to the [TinyMCE documentation](https://www.tinymce.com/docs/api/tinymce/tinymce.editor/).

```bash
'tinymce_plugins' => 'textcolor preview importcss fullscreen image link media codesample table charmap hr insertdatetime advlist lists imagetools textpattern noneditable charmap',
'tinymce_context' => 'link image imagetools table spellchecker',
'tinymce_toolbar' => 'undo redo | alignleft aligncenter alignright alignjustify | bold italic underline strikethrough | outdent indent | fontselect fontsizeselect formatselect |  numlist bullist | forecolor backcolor | charmap | image media link codesample insertdatetime fullscreen',
'tinymce_file_manager'  => true,
```

### Searchable Models

Want to be able to search in more DB tables? Read more [here](searching-models).

### Exporting

Need to export models? Read [here](exporting).

### Settings Page

Need to add or remove some fields in the Settings page? Read how to do that [here](adding-settings).

### Info Pages, Users and Articles

Additionally you can publish the configuration files for the `Info Pages`, `Articles` or `Users` modules. These files will be copied in `config/hotcoffee/{filename}` .

```bash
php artisan vendor:publish --tag=hotcoffee_config_infopages
php artisan vendor:publish --tag=hotcoffee_config_articles
php artisan vendor:publish --tag=hotcoffee_config_users
php artisan vendor:publish --tag=hotcoffee_config_settings
```
