mirror of
https://github.com/LinkStackOrg/LinkStack.git
synced 2025-01-26 17:24:53 +01:00
Disabling footer pages when inactive in config
Footer pages now return an error 404 when disabled in the config.
This commit is contained in:
parent
72387e609e
commit
ab1557110d
@ -315,10 +315,21 @@ class AdminController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
//View any of the pages: contact, terms, privacy
|
//View any of the pages: contact, terms, privacy
|
||||||
public function pages(request $request)
|
public function pages(Request $request)
|
||||||
{
|
{
|
||||||
$name = $request->name;
|
$name = $request->name;
|
||||||
|
|
||||||
|
$enabledPages = [
|
||||||
|
'contact' => env('DISPLAY_FOOTER_CONTACT', false),
|
||||||
|
'terms' => env('DISPLAY_FOOTER_TERMS', false),
|
||||||
|
'privacy' => env('DISPLAY_FOOTER_PRIVACY', false),
|
||||||
|
// Add other pages here as needed
|
||||||
|
];
|
||||||
|
|
||||||
|
if (!array_key_exists($name, $enabledPages) || !$enabledPages[$name]) {
|
||||||
|
return abort(404);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$data['page'] = Page::select($name)->first();
|
$data['page'] = Page::select($name)->first();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user