@@ -15,7 +15,7 @@ |
||
15 | 15 | { |
16 | 16 | $job_posters = JobPoster::all(); |
17 | 17 | |
18 | - $job_posters->each(function ($job_poster) { |
|
18 | + $job_posters->each(function($job_poster){ |
|
19 | 19 | $job_poster->comments()->saveMany(factory(App\Models\Comment::class, 5)->make()); |
20 | 20 | }); |
21 | 21 | } |
@@ -20,9 +20,9 @@ discard block |
||
20 | 20 | */ |
21 | 21 | public function indexByJob(JobPoster $jobPoster) |
22 | 22 | { |
23 | - Log::debug($jobPoster->id); |
|
24 | - $comments = Comment::where('job_poster_id', $jobPoster->id)->get(); |
|
25 | - return new ResourceCollection($comments); |
|
23 | + Log::debug($jobPoster->id); |
|
24 | + $comments = Comment::where('job_poster_id', $jobPoster->id)->get(); |
|
25 | + return new ResourceCollection($comments); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -33,10 +33,10 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function store(StoreComment $request) |
35 | 35 | { |
36 | - $data = $request->validated(); |
|
37 | - $comment = new Comment(); |
|
38 | - $comment->fill($data); |
|
39 | - $comment->save(); |
|
40 | - return new JsonResource($comment); |
|
36 | + $data = $request->validated(); |
|
37 | + $comment = new Comment(); |
|
38 | + $comment->fill($data); |
|
39 | + $comment->save(); |
|
40 | + return new JsonResource($comment); |
|
41 | 41 | } |
42 | 42 | } |