@@ -20,8 +20,8 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | public function indexByJob(JobPoster $jobPoster) |
| 22 | 22 | { |
| 23 | - $comments = Comment::where('job_poster_id', $jobPoster->id)->get(); |
|
| 24 | - return response()->json(new ResourceCollection($comments)); |
|
| 23 | + $comments = Comment::where('job_poster_id', $jobPoster->id)->get(); |
|
| 24 | + return response()->json(new ResourceCollection($comments)); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -32,10 +32,10 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public function store(StoreComment $request) |
| 34 | 34 | { |
| 35 | - $data = $request->validated(); |
|
| 36 | - $comment = new Comment(); |
|
| 37 | - $comment->fill($data); |
|
| 38 | - $comment->save(); |
|
| 39 | - return response()->json(new JsonResource($comment)); |
|
| 35 | + $data = $request->validated(); |
|
| 36 | + $comment = new Comment(); |
|
| 37 | + $comment->fill($data); |
|
| 38 | + $comment->save(); |
|
| 39 | + return response()->json(new JsonResource($comment)); |
|
| 40 | 40 | } |
| 41 | 41 | } |
@@ -103,13 +103,13 @@ |
||
| 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\Comment $comment |
|
| 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\Comment $comment |
|
| 111 | + * @return bool |
|
| 112 | + */ |
|
| 113 | 113 | public function viewComments(User $user) |
| 114 | 114 | { |
| 115 | 115 | // Only the manager that created a comment can view the comment. |