From ea12e81b695086f383e26790b6f9783f7987b1a5 Mon Sep 17 00:00:00 2001 From: Jason Varga Date: Fri, 1 Nov 2024 12:03:21 -0400 Subject: [PATCH] move/rename --- config/routes.php | 10 ---------- config/system.php | 11 +++++++++++ src/Entries/Collection.php | 2 +- src/Http/Controllers/FrontendController.php | 2 +- src/Taxonomies/Taxonomy.php | 2 +- tests/Routing/RoutesTest.php | 2 +- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/config/routes.php b/config/routes.php index dc49377ef6..95a6427684 100644 --- a/config/routes.php +++ b/config/routes.php @@ -53,14 +53,4 @@ 'middleware' => 'web', - /* - |-------------------------------------------------------------------------- - | Layout - |-------------------------------------------------------------------------- - | - | Define the default layout that will be used by front end routes. - | - */ - - 'layout' => env('STATAMIC_FRONTEND_ROUTES_LAYOUT', 'layout'), ]; diff --git a/config/system.php b/config/system.php index 0bc9192b40..95f4c797ff 100644 --- a/config/system.php +++ b/config/system.php @@ -194,4 +194,15 @@ 'fake_sql_queries' => config('app.debug'), + /* + |-------------------------------------------------------------------------- + | Layout + |-------------------------------------------------------------------------- + | + | Define the default layout that will be used by views. + | + */ + + 'layout' => env('STATAMIC_LAYOUT', 'layout'), + ]; diff --git a/src/Entries/Collection.php b/src/Entries/Collection.php index 2185f75461..8c89afe4be 100644 --- a/src/Entries/Collection.php +++ b/src/Entries/Collection.php @@ -442,7 +442,7 @@ public function layout($layout = null) return $this ->fluentlyGetOrSet('layout') ->getter(function ($layout) { - return $layout ?? config('statamic.routes.layout', 'layout'); + return $layout ?? config('statamic.system.layout', 'layout'); }) ->args(func_get_args()); } diff --git a/src/Http/Controllers/FrontendController.php b/src/Http/Controllers/FrontendController.php index 27cf41a096..e6c22aeba3 100644 --- a/src/Http/Controllers/FrontendController.php +++ b/src/Http/Controllers/FrontendController.php @@ -45,7 +45,7 @@ public function route(Request $request, ...$args) $view = app(View::class) ->template($view) - ->layout(Arr::get($data, 'layout', config('statamic.routes.layout', 'layout'))) + ->layout(Arr::get($data, 'layout', config('statamic.system.layout', 'layout'))) ->with($data) ->cascadeContent($this->getLoadedRouteItem($data)); diff --git a/src/Taxonomies/Taxonomy.php b/src/Taxonomies/Taxonomy.php index a404c141cc..2e5010a9c9 100644 --- a/src/Taxonomies/Taxonomy.php +++ b/src/Taxonomies/Taxonomy.php @@ -436,7 +436,7 @@ public function layout($layout = null) return $this ->fluentlyGetOrSet('layout') ->getter(function ($layout) { - return $layout ?? config('statamic.routes.layout', 'layout'); + return $layout ?? config('statamic.system.layout', 'layout'); }) ->args(func_get_args()); } diff --git a/tests/Routing/RoutesTest.php b/tests/Routing/RoutesTest.php index a2b88d1e1f..ba2d5a137b 100644 --- a/tests/Routing/RoutesTest.php +++ b/tests/Routing/RoutesTest.php @@ -345,7 +345,7 @@ public function it_loads_term_by_binding() #[Test] public function it_uses_a_non_default_layout() { - config()->set('statamic.routes.layout', 'custom-layout'); + config()->set('statamic.system.layout', 'custom-layout'); $this->viewShouldReturnRaw('custom-layout', 'Custom layout {{ template_content }}'); $this->viewShouldReturnRaw('test', 'Hello {{ hello }}');