mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
9a6f71e0d4
With the recent change to module routes being registered in their boot methods the Backend & CMS modules were registering their routes before the System module could. Due to the greedy nature of the CMS module's route it must always be registered last.
39 lines
887 B
PHP
39 lines
887 B
PHP
<?php
|
|
|
|
Event::listen('system.route', function () {
|
|
/**
|
|
* Register CMS routes before all user routes.
|
|
*/
|
|
|
|
/**
|
|
* @event cms.beforeRoute
|
|
* Fires before cms routes get added
|
|
*
|
|
* Example usage:
|
|
*
|
|
* Event::listen('cms.beforeRoute', function () {
|
|
* // your code here
|
|
* });
|
|
*
|
|
*/
|
|
Event::fire('cms.beforeRoute');
|
|
|
|
/*
|
|
* The CMS module handles all URLs that have not already been handled by the other modules & plugins.
|
|
*/
|
|
Route::any('{slug?}', 'Cms\Classes\CmsController@run')->where('slug', '(.*)?')->middleware('web');
|
|
|
|
/**
|
|
* @event cms.route
|
|
* Fires after cms routes get added
|
|
*
|
|
* Example usage:
|
|
*
|
|
* Event::listen('cms.route', function () {
|
|
* // your code here
|
|
* });
|
|
*
|
|
*/
|
|
Event::fire('cms.route');
|
|
}, PHP_INT_MIN);
|