File tree Expand file tree Collapse file tree 4 files changed +41
-1
lines changed Expand file tree Collapse file tree 4 files changed +41
-1
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace App \Http \Controllers ;
4+
5+ use Illuminate \Http \Request ;
6+
7+ class MyJobApplicationController extends Controller
8+ {
9+ public function index ()
10+ {
11+ return view (
12+ 'my_job_application.index ' ,
13+ [
14+ 'applications ' => auth ()->user ()->jobApplications ()
15+ ->with ('job ' , 'job.employer ' )
16+ ->latest ()->get ()
17+ ]
18+ );
19+ }
20+
21+ public function destroy (string $ id )
22+ {
23+ //
24+ }
25+ }
Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ class="from-10% via-30% to-90% mx-auto mt-10 max-w-2xl bg-gradient-to-r from-ind
2121 <ul class =" flex space-x-2" >
2222 @auth
2323 <li >
24- {{ auth ()-> user ()-> name ?? ' Anynomus' } }
24+ <a href =" {{ route (' my-job-applications.index' ) } }" >
25+ {{ auth ()-> user ()-> name ?? ' Anynomus' } } : Applications
26+ </a >
2527 </li >
2628 <li >
2729 <form action =" {{ route (' auth.destroy' ) } }" method =" POST" >
Original file line number Diff line number Diff line change 1+ <x-layout >
2+ <x-breadcrumbs class =" mb-4"
3+ :links =" ['My Job Applications' => '#']" />
4+
5+ @forelse ($applications as $application )
6+ <x-job-card :job =" $application->job" ></x-job-card >
7+ @empty
8+ @endforelse
9+ </x-layout >
Original file line number Diff line number Diff line change 33use App \Http \Controllers \AuthController ;
44use App \Http \Controllers \JobApplicationController ;
55use App \Http \Controllers \JobController ;
6+ use App \Http \Controllers \MyJobApplicationController ;
67use Illuminate \Support \Facades \Route ;
78
89/*
3132Route::middleware ('auth ' )->group (function () {
3233 Route::resource ('job.application ' , JobApplicationController::class)
3334 ->only (['create ' , 'store ' ]);
35+
36+ Route::resource ('my-job-applications ' , MyJobApplicationController::class)
37+ ->only (['index ' , 'destroy ' ]);
3438});
You can’t perform that action at this time.
0 commit comments