Module

Definition

A module can be a simple CRUD tool for managing data in a database, or an advanced tool for performing complex tasks, such as a Workflow Manager for example.

Uccello helps you to manage data from a database without programming. When you create a new module all the views, routes and controllers are automatically available and the UI is scaffolded by itself.

It is possible to activate or deactivate a module in some domains.

Examples

Classic module

<?php

use Uccello\Core\Models\Module;

Module::create([
    'name' => 'person',
    'icon' => 'person',
    'model_class' => 'App\Person',
    'data' => null
]);

This module named person allows to manage people from the database. This name will be translated according to the module's translation file. It is represented by the material icon called person. It is linked to the App\Person model and can access automatically to the related database table.

Admin module

<?php

use Uccello\Core\Models\Module;

Module::create([
    'name' => 'country',
    'icon' => 'terrain',
    'model_class' => 'Uccello\Address\Models\Country',
    'data' => [ "package" => "uccello/address", "admin" => true ];
]);

This is the code of the module called country , available in the uccello/address package. As this module is part of an external package we must specify the name of the package. We can do this with "package" => "uccello/address". In the same way, we link it to the Uccello\Address\Models\Country, also available in this package. As we use "admin" => true, this module is only visible in the Settings Panel by user who can administrate this module.

Common properties

Here is the list of properties common to all modules. You can specify this properties into the data attribute of the module.

You can use the data attribute to add specific properties to your module.

Last updated