Routes

A router facade is available to create module routes quicker:

1<?php
2 
3use A17\Twill\Facades\TwillRoutes;
4 
5TwillRoutes::module('yourModulePluralName');
6 
7// You can add an array of only/except action names as a second parameter
8// By default, the following routes are created : 'reorder', 'publish', 'browser', 'bucket', 'feature', 'restore', 'bulkFeature', 'bulkPublish', 'bulkDelete', 'bulkRestore'
9TwillRoutes::module('yourModulePluralName', ['except' => ['reorder', 'feature', 'bucket', 'browser']]);
10 
11// You can add an array of only/except action names for the resource controller as a third parameter
12// By default, the following routes are created : 'index', 'store', 'show', 'edit', 'update', 'destroy'
13TwillRoutes::module('yourModulePluralName', [], ['only' => ['index', 'edit', 'store', 'destroy']]);
14 
15// The last optional parameter disable the resource controller actions on the module
16TwillRoutes::module('yourPluralModuleName', [], [], false);