Skip to content

Commit

Permalink
move/rename
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Nov 1, 2024
1 parent 3b0a1ba commit ea12e81
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
10 changes: 0 additions & 10 deletions config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
];
11 changes: 11 additions & 0 deletions config/system.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),

];
2 changes: 1 addition & 1 deletion src/Entries/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/FrontendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
2 changes: 1 addition & 1 deletion src/Taxonomies/Taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Routing/RoutesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}');

Expand Down

0 comments on commit ea12e81

Please sign in to comment.