| 
				
			 | 
			
			
				@@ -24,20 +24,26 @@ class NewsController extends Controller 
			 | 
		
	
		
			
			| 
				24
			 | 
			
				24
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				25
			 | 
			
				25
			 | 
			
			
				     public function list(Request $request, $locate = 'tw') 
			 | 
		
	
		
			
			| 
				26
			 | 
			
				26
			 | 
			
			
				     { 
			 | 
		
	
		
			
			| 
				27
			 | 
			
				
			 | 
			
			
				-        $categoryId = $request->input("categoryId", ""); 
			 | 
		
	
		
			
			| 
				28
			 | 
			
				27
			 | 
			
			
				         $page = $request->input("page", 1); 
			 | 
		
	
		
			
			| 
				29
			 | 
			
				28
			 | 
			
			
				         $per_page = $request->input("per_page", 15); 
			 | 
		
	
		
			
			| 
				
			 | 
			
				29
			 | 
			
			
				+        $year = $request->input("year", -1); 
			 | 
		
	
		
			
			| 
				
			 | 
			
				30
			 | 
			
			
				+        $month = $request->input("month", -1); 
			 | 
		
	
		
			
			| 
				30
			 | 
			
				31
			 | 
			
			
				         $locate = $locate == "tw" ? "zh_TW" : $locate; 
			 | 
		
	
		
			
			| 
				31
			 | 
			
				32
			 | 
			
			
				         $result = []; 
			 | 
		
	
		
			
			| 
				32
			 | 
			
				33
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				33
			 | 
			
				
			 | 
			
			
				-        //年份清單 
			 | 
		
	
		
			
			| 
				34
			 | 
			
				
			 | 
			
			
				-        $yearList = News::select(DB::raw("DATE_FORMAT(post_date, '%Y') as years"))->distinct()->orderBy("years", "desc")->pluck("years"); 
			 | 
		
	
		
			
			| 
				35
			 | 
			
				
			 | 
			
			
				-        $result["yearList"] = $yearList; 
			 | 
		
	
		
			
			| 
				36
			 | 
			
				
			 | 
			
			
				- 
			 | 
		
	
		
			
			| 
				37
			 | 
			
				34
			 | 
			
			
				         //文章列表 
			 | 
		
	
		
			
			| 
				38
			 | 
			
				35
			 | 
			
			
				         $news = News::where("visible", 1); 
			 | 
		
	
		
			
			| 
				39
			 | 
			
				
			 | 
			
			
				-        if($categoryId){ 
			 | 
		
	
		
			
			| 
				40
			 | 
			
				
			 | 
			
			
				-            $news->where("news_category_id", $categoryId); 
			 | 
		
	
		
			
			| 
				
			 | 
			
				36
			 | 
			
			
				+        if($month > 0 || $year > 0){ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				37
			 | 
			
			
				+            $dateFilter = Carbon::now(); 
			 | 
		
	
		
			
			| 
				
			 | 
			
				38
			 | 
			
			
				+            if($year > 0){ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				39
			 | 
			
			
				+                $dateFilter->setYear(intval($year)); 
			 | 
		
	
		
			
			| 
				
			 | 
			
				40
			 | 
			
			
				+                if($month > 0){ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				41
			 | 
			
			
				+                    $dateFilter->setMonth(intval($month)); 
			 | 
		
	
		
			
			| 
				
			 | 
			
				42
			 | 
			
			
				+                    $news = $news->whereBetween("post_date", [$dateFilter->copy()->startOfMonth(), $dateFilter->copy()->endOfMonth()]); 
			 | 
		
	
		
			
			| 
				
			 | 
			
				43
			 | 
			
			
				+                }else{ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				44
			 | 
			
			
				+                    $news = $news->whereBetween("post_date", [$dateFilter->copy()->startOfYear(), $dateFilter->copy()->endOfYear()]); 
			 | 
		
	
		
			
			| 
				
			 | 
			
				45
			 | 
			
			
				+                } 
			 | 
		
	
		
			
			| 
				
			 | 
			
				46
			 | 
			
			
				+            } 
			 | 
		
	
		
			
			| 
				41
			 | 
			
				47
			 | 
			
			
				         } 
			 | 
		
	
		
			
			| 
				42
			 | 
			
				48
			 | 
			
			
				         $news = $news->orderByDesc("order")->orderByDesc("post_date"); 
			 | 
		
	
		
			
			| 
				43
			 | 
			
				49
			 | 
			
			
				         $result["pagination"] = [ 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -58,13 +64,13 @@ class NewsController extends Controller 
			 | 
		
	
		
			
			| 
				58
			 | 
			
				64
			 | 
			
			
				             $result["list"][] = [ 
			 | 
		
	
		
			
			| 
				59
			 | 
			
				65
			 | 
			
			
				                 "id" => $item->id, 
			 | 
		
	
		
			
			| 
				60
			 | 
			
				66
			 | 
			
			
				                 "categoryId" => $item->newsCategory->id, 
			 | 
		
	
		
			
			| 
				61
			 | 
			
				
			 | 
			
			
				-                "category" => $item->newsCategory->getTranslation("name", $locate), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				67
			 | 
			
			
				+                "category" => $item->newsCategory->getTranslation("name", $locate, false), 
			 | 
		
	
		
			
			| 
				62
			 | 
			
				68
			 | 
			
			
				                 "postDate" => Carbon::parse($item->post_date)->format("Y.m.d"), 
			 | 
		
	
		
			
			| 
				63
			 | 
			
				
			 | 
			
			
				-                "title" => $item->getTranslation("title", $locate), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				69
			 | 
			
			
				+                "title" => $item->getTranslation("title", $locate, false), 
			 | 
		
	
		
			
			| 
				64
			 | 
			
				70
			 | 
			
			
				                 "imgPC" => $item->news_img_pc_url, 
			 | 
		
	
		
			
			| 
				65
			 | 
			
				71
			 | 
			
			
				                 "imgMobile" => $item->news_img_mobile_url, 
			 | 
		
	
		
			
			| 
				66
			 | 
			
				
			 | 
			
			
				-                "written" => $item->getTranslation("written_by", $locate), 
			 | 
		
	
		
			
			| 
				67
			 | 
			
				
			 | 
			
			
				-                "description" => $item->getTranslation("description", $locate), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				72
			 | 
			
			
				+                "written" => $item->getTranslation("written_by", $locate, false), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				73
			 | 
			
			
				+                "description" => $item->getTranslation("description", $locate, false), 
			 | 
		
	
		
			
			| 
				68
			 | 
			
				74
			 | 
			
			
				             ]; 
			 | 
		
	
		
			
			| 
				69
			 | 
			
				75
			 | 
			
			
				         } 
			 | 
		
	
		
			
			| 
				70
			 | 
			
				76
			 | 
			
			
				         return response()->json(["data" => $result], 200); 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -77,19 +83,16 @@ class NewsController extends Controller 
			 | 
		
	
		
			
			| 
				77
			 | 
			
				83
			 | 
			
			
				         $result = []; 
			 | 
		
	
		
			
			| 
				78
			 | 
			
				84
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				79
			 | 
			
				85
			 | 
			
			
				         //年份清單 
			 | 
		
	
		
			
			| 
				80
			 | 
			
				
			 | 
			
			
				-        $yearList = News::select(DB::raw("DATE_FORMAT(post_date, '%Y') as years"))->distinct()->orderBy("years", "desc")->pluck("years"); 
			 | 
		
	
		
			
			| 
				
			 | 
			
				86
			 | 
			
			
				+        $yearList = News::select(DB::raw("DATE_FORMAT(post_date, '%Y/%m') as years"))->distinct()->orderBy("years", "desc")->pluck("years"); 
			 | 
		
	
		
			
			| 
				81
			 | 
			
				87
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				82
			 | 
			
				88
			 | 
			
			
				         //文章列表 
			 | 
		
	
		
			
			| 
				83
			 | 
			
				
			 | 
			
			
				-        $news = News::where("visible", 1); 
			 | 
		
	
		
			
			| 
				84
			 | 
			
				
			 | 
			
			
				-        if($categoryId){ 
			 | 
		
	
		
			
			| 
				85
			 | 
			
				
			 | 
			
			
				-            $news->where("news_category_id", $categoryId); 
			 | 
		
	
		
			
			| 
				86
			 | 
			
				
			 | 
			
			
				-        } 
			 | 
		
	
		
			
			| 
				87
			 | 
			
				
			 | 
			
			
				-        $news = $news->where('on_top', 1)->first(); 
			 | 
		
	
		
			
			| 
				
			 | 
			
				89
			 | 
			
			
				+        $news = News::where("visible", 1)->where('on_top', 1)->first(); 
			 | 
		
	
		
			
			| 
				
			 | 
			
				90
			 | 
			
			
				+        if($news) 
			 | 
		
	
		
			
			| 
				88
			 | 
			
				91
			 | 
			
			
				         $result["data"] = [ 
			 | 
		
	
		
			
			| 
				89
			 | 
			
				92
			 | 
			
			
				             "meta" => [ 
			 | 
		
	
		
			
			| 
				90
			 | 
			
				
			 | 
			
			
				-                "meta_title" => $news->getTranslation("meta_title", $locate), 
			 | 
		
	
		
			
			| 
				91
			 | 
			
				
			 | 
			
			
				-                "meta_keyword" => $news->getTranslation("meta_keyword", $locate), 
			 | 
		
	
		
			
			| 
				92
			 | 
			
				
			 | 
			
			
				-                "meta_description" => $news->getTranslation("meta_description", $locate), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				93
			 | 
			
			
				+                "meta_title" => $news->getTranslation("meta_title", $locate, false), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				94
			 | 
			
			
				+                "meta_keyword" => $news->getTranslation("meta_keyword", $locate, false), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				95
			 | 
			
			
				+                "meta_description" => $news->getTranslation("meta_description", $locate, false), 
			 | 
		
	
		
			
			| 
				93
			 | 
			
				96
			 | 
			
			
				                 "imgPC" => $news->news_meta_img, 
			 | 
		
	
		
			
			| 
				94
			 | 
			
				97
			 | 
			
			
				             ], 
			 | 
		
	
		
			
			| 
				95
			 | 
			
				98
			 | 
			
			
				             "yearList" =>[ 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -98,13 +101,13 @@ class NewsController extends Controller 
			 | 
		
	
		
			
			| 
				98
			 | 
			
				101
			 | 
			
			
				             "top" => [ 
			 | 
		
	
		
			
			| 
				99
			 | 
			
				102
			 | 
			
			
				                 "id" => $news->id, 
			 | 
		
	
		
			
			| 
				100
			 | 
			
				103
			 | 
			
			
				                 "categoryId" => $news->newsCategory->id, 
			 | 
		
	
		
			
			| 
				101
			 | 
			
				
			 | 
			
			
				-                "category" => $news->newsCategory->getTranslation("name", $locate), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				104
			 | 
			
			
				+                "category" => $news->newsCategory->getTranslation("name", $locate, false), 
			 | 
		
	
		
			
			| 
				102
			 | 
			
				105
			 | 
			
			
				                 "postDate" => Carbon::parse($news->post_date)->format("Y/m/d"), 
			 | 
		
	
		
			
			| 
				103
			 | 
			
				
			 | 
			
			
				-                "title" => $news->getTranslation("title", $locate), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				106
			 | 
			
			
				+                "title" => $news->getTranslation("title", $locate, false), 
			 | 
		
	
		
			
			| 
				104
			 | 
			
				107
			 | 
			
			
				                 "imgPC" => $news->news_img_pc_url, 
			 | 
		
	
		
			
			| 
				105
			 | 
			
				108
			 | 
			
			
				                 "imgMobile" => $news->news_img_mobile_url, 
			 | 
		
	
		
			
			| 
				106
			 | 
			
				
			 | 
			
			
				-                "written" => $news->getTranslation("written_by", $locate), 
			 | 
		
	
		
			
			| 
				107
			 | 
			
				
			 | 
			
			
				-                "description" => $news->getTranslation("description", $locate), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				109
			 | 
			
			
				+                "written" => $news->getTranslation("written_by", $locate, false), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				110
			 | 
			
			
				+                "description" => $news->getTranslation("description", $locate, false), 
			 | 
		
	
		
			
			| 
				108
			 | 
			
				111
			 | 
			
			
				             ] 
			 | 
		
	
		
			
			| 
				109
			 | 
			
				112
			 | 
			
			
				         ]; 
			 | 
		
	
		
			
			| 
				110
			 | 
			
				113
			 | 
			
			
				         return response()->json($result, 200); 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -149,65 +152,92 @@ class NewsController extends Controller 
			 | 
		
	
		
			
			| 
				149
			 | 
			
				152
			 | 
			
			
				         ->orderBy('post_date', 'desc') 
			 | 
		
	
		
			
			| 
				150
			 | 
			
				153
			 | 
			
			
				         ->orderBy('id', 'desc') 
			 | 
		
	
		
			
			| 
				151
			 | 
			
				154
			 | 
			
			
				         ->first(); 
			 | 
		
	
		
			
			| 
				
			 | 
			
				155
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				152
			 | 
			
				156
			 | 
			
			
				         if($previous)$otherNewsList["previous"] = [ 
			 | 
		
	
		
			
			| 
				153
			 | 
			
				157
			 | 
			
			
				             "id" => $previous->id, 
			 | 
		
	
		
			
			| 
				154
			 | 
			
				158
			 | 
			
			
				             "categoryId" => $previous->newsCategory->id, 
			 | 
		
	
		
			
			| 
				155
			 | 
			
				
			 | 
			
			
				-            "category" => $previous->newsCategory->getTranslation("name", $locate), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				159
			 | 
			
			
				+            "category" => $previous->newsCategory->getTranslation("name", $locate, false), 
			 | 
		
	
		
			
			| 
				156
			 | 
			
				160
			 | 
			
			
				             "postDate" => Carbon::parse($previous->post_date)->format("Y/m/d"), 
			 | 
		
	
		
			
			| 
				157
			 | 
			
				
			 | 
			
			
				-            "title" => $previous->getTranslation("title", $locate), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				161
			 | 
			
			
				+            "title" => $previous->getTranslation("title", $locate, false), 
			 | 
		
	
		
			
			| 
				158
			 | 
			
				162
			 | 
			
			
				             "imgPC" => $previous->news_img_pc_url, 
			 | 
		
	
		
			
			| 
				159
			 | 
			
				163
			 | 
			
			
				             "imgMobile" => $previous->news_img_mobile_url, 
			 | 
		
	
		
			
			| 
				160
			 | 
			
				
			 | 
			
			
				-            "written" => $previous->getTranslation("written_by", $locate), 
			 | 
		
	
		
			
			| 
				161
			 | 
			
				
			 | 
			
			
				-            "description" => $previous->getTranslation("description", $locate), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				164
			 | 
			
			
				+            "written" => $previous->getTranslation("written_by", $locate, false), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				165
			 | 
			
			
				+            "description" => $previous->getTranslation("description", $locate, false), 
			 | 
		
	
		
			
			| 
				162
			 | 
			
				166
			 | 
			
			
				         ]; 
			 | 
		
	
		
			
			| 
				163
			 | 
			
				167
			 | 
			
			
				         if($next)$otherNewsList["next"] = [ 
			 | 
		
	
		
			
			| 
				164
			 | 
			
				168
			 | 
			
			
				             "id" => $next->id, 
			 | 
		
	
		
			
			| 
				165
			 | 
			
				169
			 | 
			
			
				             "categoryId" => $next->newsCategory->id, 
			 | 
		
	
		
			
			| 
				166
			 | 
			
				
			 | 
			
			
				-            "category" => $next->newsCategory->getTranslation("name", $locate), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				170
			 | 
			
			
				+            "category" => $next->newsCategory->getTranslation("name", $locate, false), 
			 | 
		
	
		
			
			| 
				167
			 | 
			
				171
			 | 
			
			
				             "postDate" => Carbon::parse($previous->post_date)->format("Y/m/d"), 
			 | 
		
	
		
			
			| 
				168
			 | 
			
				
			 | 
			
			
				-            "title" => $next->getTranslation("title", $locate), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				172
			 | 
			
			
				+            "title" => $next->getTranslation("title", $locate, false), 
			 | 
		
	
		
			
			| 
				169
			 | 
			
				173
			 | 
			
			
				             "imgPC" => $next->news_img_pc_url, 
			 | 
		
	
		
			
			| 
				170
			 | 
			
				174
			 | 
			
			
				             "imgMobile" => $next->news_img_mobile_url, 
			 | 
		
	
		
			
			| 
				171
			 | 
			
				
			 | 
			
			
				-            "written" => $next->getTranslation("written_by", $locate), 
			 | 
		
	
		
			
			| 
				172
			 | 
			
				
			 | 
			
			
				-            "description" => $next->getTranslation("description", $locate), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				175
			 | 
			
			
				+            "written" => $next->getTranslation("written_by", $locate, false), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				176
			 | 
			
			
				+            "description" => $next->getTranslation("description", $locate, false), 
			 | 
		
	
		
			
			| 
				173
			 | 
			
				177
			 | 
			
			
				         ]; 
			 | 
		
	
		
			
			| 
				174
			 | 
			
				178
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				175
			 | 
			
				179
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				
			 | 
			
				180
			 | 
			
			
				+        // { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				181
			 | 
			
			
				+        //     "type": "text", 
			 | 
		
	
		
			
			| 
				
			 | 
			
				182
			 | 
			
			
				+        //     "content": "" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				183
			 | 
			
			
				+        // }, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				184
			 | 
			
			
				+        // { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				185
			 | 
			
			
				+        //     "type": "image", 
			 | 
		
	
		
			
			| 
				
			 | 
			
				186
			 | 
			
			
				+        //     "images":[{"img_url":"", "alt":""}, {"img_url":"", "alt":""}] 
			 | 
		
	
		
			
			| 
				
			 | 
			
				187
			 | 
			
			
				+        // }, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				188
			 | 
			
			
				+        // { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				189
			 | 
			
			
				+        //     "type": "video", 
			 | 
		
	
		
			
			| 
				
			 | 
			
				190
			 | 
			
			
				+        //     "is_yt":false, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				191
			 | 
			
			
				+        //     "video_img_url":"", 
			 | 
		
	
		
			
			| 
				
			 | 
			
				192
			 | 
			
			
				+        //     "video_url":"", 
			 | 
		
	
		
			
			| 
				
			 | 
			
				193
			 | 
			
			
				+        //     "content": "" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				194
			 | 
			
			
				+        // } 
			 | 
		
	
		
			
			| 
				176
			 | 
			
				195
			 | 
			
			
				         $paragraphs = []; 
			 | 
		
	
		
			
			| 
				177
			 | 
			
				196
			 | 
			
			
				         foreach($news->paragraphs as $paragraph){ 
			 | 
		
	
		
			
			| 
				178
			 | 
			
				
			 | 
			
			
				-            $paragraphs[] = [ 
			 | 
		
	
		
			
			| 
				179
			 | 
			
				
			 | 
			
			
				-                "type" => $paragraph->contentType(), 
			 | 
		
	
		
			
			| 
				180
			 | 
			
				
			 | 
			
			
				-                "imgUrl" => $paragraph->paragraph_img, 
			 | 
		
	
		
			
			| 
				181
			 | 
			
				
			 | 
			
			
				-                "imgOutLink" => $paragraph->image_link, 
			 | 
		
	
		
			
			| 
				182
			 | 
			
				
			 | 
			
			
				-                "alt" => $paragraph->getTranslation("image_alt", $locate), 
			 | 
		
	
		
			
			| 
				183
			 | 
			
				
			 | 
			
			
				-                "content" => nl2br($paragraph->getTranslation("text_content", $locate)), 
			 | 
		
	
		
			
			| 
				184
			 | 
			
				
			 | 
			
			
				-                "videoImg" => $paragraph->paragraph_video_img, 
			 | 
		
	
		
			
			| 
				185
			 | 
			
				
			 | 
			
			
				-                "videoType" => $paragraph->paragraph_video_type, 
			 | 
		
	
		
			
			| 
				186
			 | 
			
				
			 | 
			
			
				-                "link" => $paragraph->paragraph_video_url, 
			 | 
		
	
		
			
			| 
				187
			 | 
			
				
			 | 
			
			
				-            ]; 
			 | 
		
	
		
			
			| 
				188
			 | 
			
				
			 | 
			
			
				-        } 
			 | 
		
	
		
			
			| 
				189
			 | 
			
				
			 | 
			
			
				-        $extraPhotos = []; 
			 | 
		
	
		
			
			| 
				190
			 | 
			
				
			 | 
			
			
				-        foreach($news->photos as $photo){ 
			 | 
		
	
		
			
			| 
				191
			 | 
			
				
			 | 
			
			
				-            $extraPhotos[] = [ 
			 | 
		
	
		
			
			| 
				192
			 | 
			
				
			 | 
			
			
				-                "imgUrl" => $photo->news_photo_img, 
			 | 
		
	
		
			
			| 
				193
			 | 
			
				
			 | 
			
			
				-                "imgOutLink" => $photo->image_link, 
			 | 
		
	
		
			
			| 
				194
			 | 
			
				
			 | 
			
			
				-            ]; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				197
			 | 
			
			
				+            $content = []; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				198
			 | 
			
			
				+            switch ($paragraph->contentType()){ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				199
			 | 
			
			
				+                case "text": 
			 | 
		
	
		
			
			| 
				
			 | 
			
				200
			 | 
			
			
				+                    $paragraphs[] = [ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				201
			 | 
			
			
				+                        "type" => $paragraph->contentType(), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				202
			 | 
			
			
				+                        "content" => nl2br($paragraph->getTranslation("text_content", $locate, false)), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				203
			 | 
			
			
				+                    ]; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				204
			 | 
			
			
				+                    break; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				205
			 | 
			
			
				+                case "image": 
			 | 
		
	
		
			
			| 
				
			 | 
			
				206
			 | 
			
			
				+                    $photos = $paragraph->photos; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				207
			 | 
			
			
				+                    $images = []; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				208
			 | 
			
			
				+                    foreach($photos as $photo){ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				209
			 | 
			
			
				+                        $images[] = ["img_url" => $photo->img_url, "alt" => $photo->getTranslation("image_alt", $locate, false)]; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				210
			 | 
			
			
				+                    } 
			 | 
		
	
		
			
			| 
				
			 | 
			
				211
			 | 
			
			
				+                    $paragraphs[] = [ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				212
			 | 
			
			
				+                        "type" => $paragraph->contentType(), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				213
			 | 
			
			
				+                        "images" => $images, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				214
			 | 
			
			
				+                    ]; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				215
			 | 
			
			
				+                    break; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				216
			 | 
			
			
				+                case "video": 
			 | 
		
	
		
			
			| 
				
			 | 
			
				217
			 | 
			
			
				+                    $paragraphs[] = [ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				218
			 | 
			
			
				+                        "type" => $paragraph->contentType(), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				219
			 | 
			
			
				+                        "video_img_url" => $paragraph->paragraph_video_img, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				220
			 | 
			
			
				+                        "is_yt" => $paragraph->video_type == 1 ? true : false, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				221
			 | 
			
			
				+                        "content" => $paragraph->getTranslation("video_img_alt", $locate, false), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				222
			 | 
			
			
				+                        "video_url" => $paragraph->paragraph_video_url, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				223
			 | 
			
			
				+                    ]; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				224
			 | 
			
			
				+                    break; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				225
			 | 
			
			
				+            } 
			 | 
		
	
		
			
			| 
				195
			 | 
			
				226
			 | 
			
			
				         } 
			 | 
		
	
		
			
			| 
				196
			 | 
			
				227
			 | 
			
			
				         $result = [ 
			 | 
		
	
		
			
			| 
				197
			 | 
			
				228
			 | 
			
			
				             "categoryId" => $news->newsCategory->id, 
			 | 
		
	
		
			
			| 
				198
			 | 
			
				
			 | 
			
			
				-            "category" => $news->newsCategory->getTranslation("name", $locate), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				229
			 | 
			
			
				+            "category" => $news->newsCategory->getTranslation("name", $locate, false), 
			 | 
		
	
		
			
			| 
				199
			 | 
			
				230
			 | 
			
			
				             "postDate" => Carbon::parse($news->post_date)->format("Y/m/d"), 
			 | 
		
	
		
			
			| 
				200
			 | 
			
				
			 | 
			
			
				-            "title" => $news->getTranslation("title", $locate), 
			 | 
		
	
		
			
			| 
				201
			 | 
			
				
			 | 
			
			
				-            "description" => $news->getTranslation("description", $locate), 
			 | 
		
	
		
			
			| 
				202
			 | 
			
				
			 | 
			
			
				-            "written" => $news->getTranslation("written_by", $locate), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				231
			 | 
			
			
				+            "title" => $news->getTranslation("title", $locate, false), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				232
			 | 
			
			
				+            "description" => $news->getTranslation("description", $locate, false), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				233
			 | 
			
			
				+            "written" => $news->getTranslation("written_by", $locate, false), 
			 | 
		
	
		
			
			| 
				203
			 | 
			
				234
			 | 
			
			
				             "imgPC" => $news->news_img_pc_url, 
			 | 
		
	
		
			
			| 
				204
			 | 
			
				235
			 | 
			
			
				             "imgMobile" => $news->news_img_mobile_url, 
			 | 
		
	
		
			
			| 
				205
			 | 
			
				
			 | 
			
			
				-            "metaTitle" => $news->getTranslation("meta_title", $locate), 
			 | 
		
	
		
			
			| 
				206
			 | 
			
				
			 | 
			
			
				-            "metaKeyword" => $news->getTranslation("meta_keyword", $locate), 
			 | 
		
	
		
			
			| 
				207
			 | 
			
				
			 | 
			
			
				-            "metaDesc" => $news->getTranslation("meta_description", $locate), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				236
			 | 
			
			
				+            "metaTitle" => $news->getTranslation("meta_title", $locate, false), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				237
			 | 
			
			
				+            "metaKeyword" => $news->getTranslation("meta_keyword", $locate, false), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				238
			 | 
			
			
				+            "metaDesc" => $news->getTranslation("meta_description", $locate, false), 
			 | 
		
	
		
			
			| 
				208
			 | 
			
				239
			 | 
			
			
				             "metaImg" => $news->meta_img, 
			 | 
		
	
		
			
			| 
				209
			 | 
			
				240
			 | 
			
			
				             "paragraphs" => $paragraphs, 
			 | 
		
	
		
			
			| 
				210
			 | 
			
				
			 | 
			
			
				-            "photos" => $extraPhotos, 
			 | 
		
	
		
			
			| 
				211
			 | 
			
				241
			 | 
			
			
				             "otherNews" => $otherNewsList 
			 | 
		
	
		
			
			| 
				212
			 | 
			
				242
			 | 
			
			
				         ]; 
			 | 
		
	
		
			
			| 
				213
			 | 
			
				243
			 | 
			
			
				         return response()->json(["data" => $result], 200); 
			 |