From feea5d9e6a076af1acd526d17f9c8004bcb8dd3d Mon Sep 17 00:00:00 2001 From: Brandon Date: Sat, 24 Aug 2024 18:10:04 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Restore=20default=20routing=20re?= =?UTF-8?q?moved=20in=20#387?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Roots/Acorn/Application.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Roots/Acorn/Application.php b/src/Roots/Acorn/Application.php index ce1c7778..ef75497b 100644 --- a/src/Roots/Acorn/Application.php +++ b/src/Roots/Acorn/Application.php @@ -69,12 +69,19 @@ public static function configure(?string $basePath = null) default => ApplicationBuilder::inferBasePath(), }; + $web = $basePath.'/routes/web.php'; + $api = $basePath.'/routes/api.php'; + return (new ApplicationBuilder(new static($basePath))) ->withPaths() ->withKernels() ->withEvents() ->withCommands() ->withProviders() + ->withRouting( + web: file_exists($web) ? $web : null, + api: file_exists($api) ? $api : null, + ) ->withMiddleware() ->withExceptions(); }