|
|
@@ -28,7 +28,7 @@ class HomePageController extends Controller
|
|
28
|
28
|
{
|
|
29
|
29
|
$locale = $locale == "tw" ? "zh_TW" : $locale;
|
|
30
|
30
|
$result = [];
|
|
31
|
|
- $banners = Banner::where("visible", true)->get()->map(function ($record) use ($result, $locale){
|
|
|
31
|
+ $banners = Banner::where("visible", true)->get()->map(function ($record) use (&$result, $locale){
|
|
32
|
32
|
$result[] = [
|
|
33
|
33
|
"imgUrl" => $record->imgUrlLink,
|
|
34
|
34
|
"mobileImgUrl" => $record->mobileImgLink,
|
|
|
@@ -36,6 +36,7 @@ class HomePageController extends Controller
|
|
36
|
36
|
"content" => $record->getTranslation("content", $locale),
|
|
37
|
37
|
];
|
|
38
|
38
|
});
|
|
|
39
|
+ return Response::ok($result);
|
|
39
|
40
|
}
|
|
40
|
41
|
|
|
41
|
42
|
public function list($locale = 'tw')
|