From 8cedcabd1fe15747b2e1b474e197d524f6490c4d Mon Sep 17 00:00:00 2001 From: markus Date: Mon, 23 Sep 2024 14:57:17 +0200 Subject: [PATCH] Add parameter 'apiPrefix' to Application::configure --- src/Foundation/Application.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Foundation/Application.php b/src/Foundation/Application.php index 6f62274..d35b9a2 100644 --- a/src/Foundation/Application.php +++ b/src/Foundation/Application.php @@ -15,8 +15,10 @@ class Application extends BaseApplication { - public static function configure(?string $basePath = null) - { + public static function configure( + ?string $basePath = null, + string $apiPrefix = 'api', + ) { $basePath = match (true) { is_string($basePath) => $basePath, default => static::inferBasePath(), @@ -40,6 +42,7 @@ public static function configure(?string $basePath = null) web: $routeFile($app->basePath('routes/web.php')), api: $routeFile($app->basePath('routes/api.php')), commands: $routeFile($app->basePath('routes/console.php')), + apiPrefix: $apiPrefix, then: fn () => require __DIR__ . '/../routes.php', ) ->withMiddleware(function (Middleware $middleware) {