Hello, how do I achieve in October CMS in my plugin a routing system that redirects various URLs to /admin, i.e., to the admin panel, when entered? However, it should not redirect if it is an API route or the direct /admin address?
// Redirect all other routes to the /admin page except api endpoints
Route::any('{any}', function($any) {
if (preg_match('#^api/lakemanagement|admin#', $any)) {
return;
}
return Redirect::to('/admin');
})->where('any', '.*');