Routing
You can register Control Panel routes to build custom pages.
Hot Tip!
This guide is intended for apps adding routes to the Control Panel. If you're building an addon, please see our Building an Addon guide instead.

To register a custom route:
-
Create a routes file. Name it whatever you want, for example:
routes/cp.php
-
Then push the routes by adding this to your
app/Providers/AppServiceProvider.php
:use Illuminate\Support\Facades\Route;use Statamic\Statamic;public function boot(){Statamic::pushCpRoutes(function () {Route::namespace('\App\Http\Controllers')->group(function () {require base_path('routes/cp.php');});});} -
Any routes in the file will have the appropriate name prefix and middleware applied.
Docs Feedback
Submit improvements, related content, or suggestions through Github.
Betterify this page