# Routes

## Definition

A route is a way to access to resources. It is represented by a unique URL.

Modules can be classified into two categories:

* Modules that allow records management.
* Modules that add functionality without necessarily being linked to specific records.

Thanks to the [programming concept ](https://uccello.gitbook.io/doc/preamble/functionality-oriented-programming)used by Uccello, when you create a new module, several routes are automatically available.

Depending on the type of module we have created, the following routes are available by default:

{% hint style="warning" %}
For modules not linked to records, only the`uccello.index` route is available.
{% endhint %}

## Default routes

| Name                | URL                                                                              | Description                                                                                                                               |
| ------------------- | -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| **uccello.index**   | /{domain}/{module}                                                               | By default the displayed page is empty. But you can customize it to display different information.                                        |
| **uccello.list**    | /{domain}/{module}/list                                                          | List of your module's records.                                                                                                            |
| **uccello.detail**  | /{domain}/{module}/detail?id=\[0-9]+                                             | Record detail page.                                                                                                                       |
| **uccello.edit**    | <p>/{domain}/{module}/edit</p><p>or</p><p>/{domain}/{module}/edit?id=\[0-9]+</p> | <p>Page to create a new record.</p><p></p><p>Record edit page.</p><p></p>                                                                 |
| **uccello.delete**  | /{domain}/{module}/delete?id=\[0-9]+                                             | <p>URL to delete a record.</p><p></p>                                                                                                     |
| **uccello.restore** | /{domain}/{module}/restore?id=\[0-9]+                                            | URL to restore a record from the trash.                                                                                                   |
| **uccello.tree**    | /{domain}/{module}/tree                                                          | List of your module's records represented in a tree. This view is only accessible if your Model extends `\Gzero\EloquentTree\Model\Tree`. |

{% hint style="info" %}
If multi domains option is not activated, `/{domain}/{module}` is replaced by `/{module}` in all URL.
{% endhint %}

The helper function `ucroute()` helps you to call an Uccello's route, for example:

```php
ucroute('uccello.list', $domain, $module);
// Example: /uccello/person/list
```

or with params:

```php
ucroute('uccello.edit', $domain, $module, [ 'id' => 1 ]);
// Example: /uccello/person/edit?id=1
```

{% hint style="info" %}
If multi domains option is not activated, the domain will not be present in the generated route.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://uccello.gitbook.io/doc/the-basics/routes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
