# Config file

## Publishing

You can publish the Uccello's config file using the following command:

```bash
php artisan vendor:publish --tag=uccello-config
```

This will create a file located at `config/uccello.php` with the following content:

```php
<?php

return [
    'theme' => 'uccello',

    'domains' => [
        'display_tree' => true,
        'open_tree' => true,
    ],

    'max_results' => [
        'search' => 50,
        'autocomplete' => 10,
    ],

    'format' => [
        'php' => [
            'date' => 'd/m/Y',
            'datetime' => 'd/m/Y H:i',
            'time' => 'H:i',
        ],
        'js' => [
            'date' => 'DD/MM/YYYY',
            'datetime' => 'DD/MM/YYYY HH:mm',
            'time' => 'HH:mm',
        ],
    ],

    'roles' => [
        'display_ancestors_roles' => true,
    ],

    'treeview' => [
        'open_tree' => true,
    ],
    
    'users' => [
        'display_all_users_with_role' => false,
        'display_all_admin_users' => false,
        'assigned_user_filter_users_groups' => true,
        'max_connections_displayed' => 100,
    ],
];
```

## Configuration

### Theme

```php
[
    'theme' => 'uccello'
]
```

| Parameter |  Type  | Description                                                                                                        |  Default  |
| --------- | :----: | ------------------------------------------------------------------------------------------------------------------ | :-------: |
| **theme** | string | <p>Name of the theme you want to use.<br>Refer to <a href="themes">Themes</a> page for creating custom themes.</p> | `uccello` |

### Domains

```php
[
    'domains' => [
        'display_tree' => true,
        'open_tree' => true,
    ],
]
```

This options are used only when [multi-domain](https://uccello.gitbook.io/doc/security/domain#multi-domain-or-not) management is enabled.

| Parameter         |   Type  | Description                                                                                                                                                                                                                                                                                                                                    | Default |
| ----------------- | :-----: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-----: |
| **display\_tree** | boolean | If `true`, display the [modal](https://uccello.gitbook.io/doc/security/domain#header) for switching between domains.                                                                                                                                                                                                                           |  `true` |
| **open\_tree**    | boolean | <p>If <code>true</code>, the domain tree is automatically opened in the <a href="../../security/domain#header">modal</a>.  If <code>false</code>, the user have to click on each domain tree node to load its children domains.</p><p>This option is very useful when you want to manage a big number of domains in a Uccello application.</p> |  `true` |

### Max results

```php
[
    'max_results' => [
        'search' => 50,
        'autocomplete' => 10,
    ]
]
```

| Parameter        | Type | Description                                                                    | Default |
| ---------------- | :--: | ------------------------------------------------------------------------------ | :-----: |
| **search**       |  int | Maximum number of results for each module, for a global search on all modules. |   `50`  |
| **autocomplete** |  int | Maximum number of results for each module, for an autocomplete field.          |   `10`  |

### Format

```php
[
    'format' => [
        'php' => [
            'date' => 'd/m/Y',
            'datetime' => 'd/m/Y H:i',
            'time' => 'H:i',
        ],
        'js' => [
            'date' => 'DD/MM/YYYY',
            'datetime' => 'DD/MM/YYYY HH:mm',
            'time' => 'HH:mm',
        ],
    ]
]
```

#### PHP

| Parameter    |  Type  | Description                      |   Default   |
| ------------ | :----: | -------------------------------- | :---------: |
| **date**     | string | Date format to use with PHP.     |   `d/m/Y`   |
| **datetime** | string | DateTime format to use with PHP. | `d/m/Y H:i` |
| **time**     | string | Time format to use with PHP.     |    `H:i`    |

#### JS

| Parameter    |  Type  | Description                             |       Default      |
| ------------ | :----: | --------------------------------------- | :----------------: |
| **date**     | string | Date format to use with JavaScript.     |    `DD/MM/YYYY`    |
| **datetime** | string | DateTime format to use with JavaScript. | `DD/MM/YYYY HH:mm` |
| **time**     | string | Time format to use with JavaScript.     |       `HH:mm`      |

### Roles

```php
[
    'roles' => [
        'display_ancestors_roles' => false,
    ]
]
```

| Parameter                     | Type | Description                                                                                     | Default |
| ----------------------------- | :--: | ----------------------------------------------------------------------------------------------- | :-----: |
| **display\_ancestors\_roles** | bool | If `true`, displays in the current domain, the list of the roles created in an ancestor domain. | `false` |

### Treeview

```php
[
    'treeview' => [
        'open_tree' => true,
    ]
]
```

| Parameter      | Type | Description                                                                                                                                              | Default |
| -------------- | :--: | -------------------------------------------------------------------------------------------------------------------------------------------------------- | :-----: |
| **open\_true** | bool | If `true`, the domain tree is automatically opened in the Tree View.  If `false`, the user have to click on each tree node to load its children records. |  `true` |

### Users

```php
[
    'users' => [
        'display_all_users_with_role' => false,
        'display_all_admin_users' => false,
        'assigned_user_filter_users_groups' => true,
        'max_connections_displayed' => 100,
    ]
]
```

| Parameter                                 | Type | Description                                                                                                                                                                                                             | Default |
| ----------------------------------------- | :--: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-----: |
| **display\_all\_users\_with\_role**       | bool | If `true`, all users with a role defined in the current domain or in an ancestor one will be shown in the users list.                                                                                                   | `false` |
| **display\_all\_admin\_users**            | bool | If `true`, all admin users will be shown in the users list.                                                                                                                                                             | `false` |
| **assigned\_user\_filter\_users\_groups** | bool | If `true`, any [AssignedUser](https://uccello.gitbook.io/doc/uitypes-displaytypes/default-uitypes#assigned-user) Uitype will display a filtered list of users and groups. Else, all groups and users will be displayed. |  `true` |
| **max\_connections\_displayed**           |  int | Maximum number of connections displayed in the connection log of a user.                                                                                                                                                |  `100`  |
