diff --git a/job-board/app/Http/Controllers/MyJobApplicationController.php b/job-board/app/Http/Controllers/MyJobApplicationController.php new file mode 100644 index 0000000..a8f1092 --- /dev/null +++ b/job-board/app/Http/Controllers/MyJobApplicationController.php @@ -0,0 +1,47 @@ + auth()->user() + ->jobApplications() + ->with([ + 'job' => fn($query) => $query->withCount('jobApplications') + ->with('employer')->withAvg('jobApplications', 'expected_salary') + ]) + ->latest() + ->get() + ] + ); + } + + /** + * Display the specified resource. + */ + public function show(string $id) + { + // + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(JobApplication $jobApplication) + { + $jobApplication->delete(); + + return redirect()->back()->with('success', 'Job application removed.'); + } +} \ No newline at end of file diff --git a/job-board/resources/views/components/layout.blade.php b/job-board/resources/views/components/layout.blade.php index b01f578..c7a4d6a 100644 --- a/job-board/resources/views/components/layout.blade.php +++ b/job-board/resources/views/components/layout.blade.php @@ -21,7 +21,9 @@ class="from-10% via-30% to-90% mx-auto mt-10 max-w-2xl bg-gradient-to-r from-ind