diff --git a/app/Application.php b/app/Application.php index 319296a..729d610 100644 --- a/app/Application.php +++ b/app/Application.php @@ -13,4 +13,9 @@ class Application extends Model 'applicantStatus' ]; + + public function user() + { + return $this->belongsTo('App\User', 'applicantUserID', 'id'); + } } diff --git a/app/Http/Controllers/ApplicationController.php b/app/Http/Controllers/ApplicationController.php index 0d2cb5f..cfd2a9e 100644 --- a/app/Http/Controllers/ApplicationController.php +++ b/app/Http/Controllers/ApplicationController.php @@ -13,20 +13,13 @@ use Illuminate\Support\Facades\Validator; class ApplicationController extends Controller { - public function showPendingUserApps() + public function showUserApps() { - return view('dashboard.user.applications'); + + return view('dashboard.user.applications') + ->with('applications', Auth::user()->applications); } - public function showDeniedUserApps() - { - return view('dashboard.user.deniedapplications'); - } - - public function showApprovedApps() - { - return view('dashboard.user.approvedapplications'); - } public function showAllPendingApps() { diff --git a/app/User.php b/app/User.php index c45acbc..f2d62db 100644 --- a/app/User.php +++ b/app/User.php @@ -36,4 +36,9 @@ class User extends Authenticatable protected $casts = [ 'email_verified_at' => 'datetime', ]; + + public function applications() + { + return $this->hasMany('App\Application', 'applicantUserID', 'id'); + } } diff --git a/config/adminlte.php b/config/adminlte.php index 8c54c3f..51338db 100644 --- a/config/adminlte.php +++ b/config/adminlte.php @@ -214,19 +214,9 @@ return [ 'icon' => 'fas fa-fw fa-list-ul', 'submenu' => [ [ - 'text' => 'Under Review', + 'text' => 'Current Applications', 'icon' => 'fas fa-fw fa-check-double', - 'url' => '/applications/pending' - ], - [ - 'text' => 'Denied', - 'icon' => 'fas fa-fw fa-times', - 'url' => '/applications/denied' - ], - [ - 'text' => 'Approved', - 'icon' => 'fas fa-fw fa-user-check', - 'url' => '/applications/approved' + 'url' => '/applications/current' ] ] diff --git a/resources/views/dashboard/user/applications.blade.php b/resources/views/dashboard/user/applications.blade.php index 523974c..28deba7 100644 --- a/resources/views/dashboard/user/applications.blade.php +++ b/resources/views/dashboard/user/applications.blade.php @@ -39,6 +39,18 @@
If an interview is scheduled, you'll need to open your application here and confirm the time, date, and location assigned for you.
+Your account is currently {{($isEligibleForApplication) ? 'eligible' : 'not eligible'}} for application.
+ + @if (!$isEligibleForApplication) +As of today, there are {{$eligibilityDaysRemaining}} days remaining until you're permitted to submit another application.
+ @endif + + Powered by Carbon +