A Laravel model-based CMS
By Bukwild

View on GitHub
Case study


Standard CRUD routes

Decoy registers a wildcard admin/* route. It parses the requested path to determine what controller and action should be used. The route is parsed by taking dash-delimited slugs of the controller and converting them to StudlyCased controller names and snakeCased actions on the controller. You can read the Bkwld\Decoy\Controllers\Base docs for all of the default actions, but here’s an example of the more significant ones:

Assuming your model is App\ProjectCategory with a controller of App\Http\Controllers\Admin\ProjectCategories:

Creating custom routes

Decoy’s wildcard router will interfere with creating custom /admin routes because it runs before app routes gets registered (and I haven’t found a way to delay it). You can stop Decoy from registering it’s routes via the decoy.core.register_routes boolean config value and then manually register them after you finish registering your own routes. Thus: