Completed
Push — development ( b00a9d...82e2af )
by Claudio
02:27
created
app/Http/Controllers/ArticleController.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,8 +75,9 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.