From 8f898ac6f94d578c30f8f419ec2b53baaa084e5d Mon Sep 17 00:00:00 2001 From: James-jamames Date: Fri, 2 Feb 2024 16:20:32 -0300 Subject: [PATCH] + News class + FAQ route fix --- server/app/Models/PopUp.php | 38 +++++++++++++++++++++++++++++++++++++ server/routes/web.php | 6 +++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 server/app/Models/PopUp.php diff --git a/server/app/Models/PopUp.php b/server/app/Models/PopUp.php new file mode 100644 index 0000000..659b903 --- /dev/null +++ b/server/app/Models/PopUp.php @@ -0,0 +1,38 @@ +get(); + + foreach($popups as $popup) + { + foreach($popup->translations as $translation) + { + $popup[$translation->column_name] = $translation->value; + } + + unset($popup->translations); + } + + return $popups; + } +} \ No newline at end of file diff --git a/server/routes/web.php b/server/routes/web.php index e860086..9efa9ad 100644 --- a/server/routes/web.php +++ b/server/routes/web.php @@ -52,7 +52,11 @@ return Methodology::getTranslate($lang); }); -Route::get('/api/FAQ/{lang}', function (string $lang) { +Route::get('/api/popup/{lang}', function (string $lang) { + return FAQ::getTranslate($lang); +}); + +Route::get('/api/faq/{lang}', function (string $lang) { return FAQ::getTranslate($lang); });