Skip to content

Commit

Permalink
Add parameter 'apiPrefix' to Application::configure
Browse files Browse the repository at this point in the history
  • Loading branch information
ttrig committed Sep 23, 2024
1 parent 4ab318e commit 8cedcab
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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) {
Expand Down

0 comments on commit 8cedcab

Please sign in to comment.