Skip to content

Adding a custom module

Thorazine edited this page Jun 7, 2017 · 2 revisions

Adding a custom module has been made easy to do, but requires a few steps.

Running the command

We have created a command form creation of a basic setup for a "flat" module. And with "flat" we mean: a single table module. To do so:

php artisan hack:module

The command will take you through all the steps.

Adding inputs

Each module can have all the entry types you can add or make. A lot of the wanted entry types (inputs) are already included, but custom ones are easily made and added. For more information about the inputs and how to add them look here.

Adding routes

After the console run your module has a short name, it is the snake_case of what you entered at creation. The name can be found in the created controller. In the routes/cms-custom.php you will find a group in which you can add your route. An example has been provided and additional information can be found in the HackRouteServiceProvider.

Adding translations

Translations should be added to resources/lang/[language]/modules.php. The database names defined in the $types are the keys for the translation.

Adding rights

Clone this wiki locally