Total Complexity | 7 |
Total Lines | 82 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class ClaimJobApiController extends Controller |
||
11 | { |
||
12 | /** |
||
13 | * Display a listing of the resource. |
||
14 | * |
||
15 | * @return \Illuminate\Http\Response |
||
1 ignored issue
–
show
|
|||
16 | */ |
||
17 | public function index() |
||
18 | { |
||
19 | } |
||
20 | |||
21 | /** |
||
1 ignored issue
–
show
|
|||
22 | * Store a newly created resource in storage. |
||
23 | * |
||
24 | * @param \Illuminate\Http\Request $request |
||
1 ignored issue
–
show
|
|||
25 | * @param \App\Models\JobPoster $jobPoster |
||
2 ignored issues
–
show
|
|||
26 | * @return \Illuminate\Http\Response |
||
27 | */ |
||
28 | public function store(Request $request, JobPoster $job) |
||
29 | { |
||
30 | $this->claimJob($request->user()->hr_advisor, $job); |
||
31 | |||
32 | return response()->json(['status' => 'ok']); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * Display the specified resource. |
||
37 | * |
||
38 | * @param \App\Models\HrAdvisor $hrAdvisor |
||
2 ignored issues
–
show
|
|||
39 | * @return \Illuminate\Http\Response |
||
1 ignored issue
–
show
|
|||
40 | */ |
||
41 | public function show(HrAdvisor $hrAdvisor) |
||
42 | { |
||
43 | } |
||
44 | |||
45 | /** |
||
1 ignored issue
–
show
|
|||
46 | * Update the specified resource in storage. |
||
47 | * |
||
48 | * @param \Illuminate\Http\Request $request |
||
1 ignored issue
–
show
|
|||
49 | * @param \App\Models\JobPoster $jobPoster |
||
2 ignored issues
–
show
|
|||
50 | * @return \Illuminate\Http\Response |
||
1 ignored issue
–
show
|
|||
51 | */ |
||
52 | public function update(Request $request, JobPoster $job) |
||
54 | } |
||
55 | |||
56 | /** |
||
1 ignored issue
–
show
|
|||
57 | * Remove the specified resource from storage. |
||
58 | * |
||
59 | * @param \Illuminate\Http\Request $request |
||
1 ignored issue
–
show
|
|||
60 | * @param \App\Models\JobPoster $jobPoster |
||
2 ignored issues
–
show
|
|||
61 | * @return \Illuminate\Http\Response |
||
62 | */ |
||
63 | public function destroy(Request $request, JobPoster $job) |
||
68 | } |
||
69 | |||
70 | /** |
||
71 | * Claim a Job Poster. |
||
72 | * |
||
73 | * @param \App\Models\HrAdvisor $hrAdvisor |
||
2 ignored issues
–
show
|
|||
74 | * @param \App\Models\JobPoster $job |
||
2 ignored issues
–
show
|
|||
75 | * @return \Illuminate\Http\Response |
||
1 ignored issue
–
show
|
|||
76 | */ |
||
77 | public function claimJob(HrAdvisor $hrAdvisor, JobPoster $job) |
||
78 | { |
||
79 | $hrAdvisor->claimed_jobs()->attach($job); |
||
80 | } |
||
81 | |||
82 | /** |
||
83 | * Unclaim a Job Poster. |
||
84 | * |
||
85 | * @param \App\Models\HrAdvisor $hrAdvisor |
||
2 ignored issues
–
show
|
|||
86 | * @param \App\Models\JobPoster $job |
||
2 ignored issues
–
show
|
|||
87 | * @return \Illuminate\Http\Response |
||
1 ignored issue
–
show
|
|||
88 | */ |
||
89 | public function unclaimJob(HrAdvisor $hrAdvisor, JobPoster $job) |
||
92 | } |
||
93 | } |
||
94 |