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); });