Passed
Push — task/comment-model-and-api ( 93ce51 )
by Yonathan
12:40
created
app/Policies/JobPolicy.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -103,13 +103,13 @@
 block discarded – undo
103 103
             $jobPoster->isClosed();
104 104
     }
105 105
 
106
-     /**
107
-     * Determine whether the user can view the comments.
108
-     *
109
-     * @param \App\Models\User $user
110
-     * @param \App\Models\JobPoster $jobPoster
111
-     * @return bool
112
-     */
106
+        /**
107
+         * Determine whether the user can view the comments.
108
+         *
109
+         * @param \App\Models\User $user
110
+         * @param \App\Models\JobPoster $jobPoster
111
+         * @return bool
112
+         */
113 113
     public function viewComments(User $user, JobPoster $jobPoster) : bool
114 114
     {
115 115
         // Only the manager that created a comment can view the comment.
Please login to merge, or discard this patch.
app/Http/Controllers/Api/CommentController.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public function indexByJob(JobPoster $jobPoster)
23 23
     {
24
-          $comments = Comment::where('job_poster_id', $jobPoster->id)->get();
25
-          return response()->json(new ResourceCollection($comments));
24
+            $comments = Comment::where('job_poster_id', $jobPoster->id)->get();
25
+            return response()->json(new ResourceCollection($comments));
26 26
     }
27 27
 
28 28
     /**
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function store(StoreComment $request, JobPoster $jobPoster)
36 36
     {
37
-          $data = $request->validated();
38
-          $comment = new Comment();
39
-          $comment->fill($data);
40
-          $comment->save();
41
-          return response()->json(new JsonResource($comment));
37
+            $data = $request->validated();
38
+            $comment = new Comment();
39
+            $comment->fill($data);
40
+            $comment->save();
41
+            return response()->json(new JsonResource($comment));
42 42
     }
43 43
 }
Please login to merge, or discard this patch.