@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | protected function category(string $countryId, ArticleCategory $category, int $categoryPage, int $start): Response |
| 57 | 57 | { |
| 58 | - $articles = Article::where('id', '>=', $start)->limit(10)->orderBy('id', 'DESC')->get()->filter(function ($item) use ($category) { |
|
| 58 | + $articles = Article::where('id', '>=', $start)->limit(10)->orderBy('id', 'DESC')->get()->filter(function($item) use ($category) { |
|
| 59 | 59 | return $category->name == 'all' || in_array($category, $item->categories); |
| 60 | 60 | }); |
| 61 | 61 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | if (($article = Article::find(strstr($articleName, '_', true))) == null) |
| 79 | 79 | return response()->json(null, 404); |
| 80 | 80 | |
| 81 | - $related = ($latest = Article::all())->filter(function ($item) use ($article) { |
|
| 81 | + $related = ($latest = Article::all())->filter(function($item) use ($article) { |
|
| 82 | 82 | return in_array($article->categories[0], $item->categories); |
| 83 | 83 | }); |
| 84 | 84 | |
@@ -75,8 +75,9 @@ |
||
| 75 | 75 | */ |
| 76 | 76 | public function one(string $countryId, string $articleName): Response |
| 77 | 77 | { |
| 78 | - if (($article = Article::find(strstr($articleName, '_', true))) == null) |
|
| 79 | - return response()->json(null, 404); |
|
| 78 | + if (($article = Article::find(strstr($articleName, '_', true))) == null) { |
|
| 79 | + return response()->json(null, 404); |
|
| 80 | + } |
|
| 80 | 81 | |
| 81 | 82 | $related = ($latest = Article::all())->filter(function ($item) use ($article) { |
| 82 | 83 | return in_array($article->categories[0], $item->categories); |