diff --git a/app/Http/Controllers/Auth/RegisteredUserController.php b/app/Http/Controllers/Auth/RegisteredUserController.php index a87e9e8..9978c91 100644 --- a/app/Http/Controllers/Auth/RegisteredUserController.php +++ b/app/Http/Controllers/Auth/RegisteredUserController.php @@ -122,9 +122,6 @@ class RegisteredUserController extends Controller // Log the user in after successful registration Auth::login($user); - //send notification to user - $application = Application::max('id') + 1; - $user->notify(new \App\Notifications\InstructorApplicant($application)); return redirect(RouteServiceProvider::HOME); } catch (\Exception $e) { @@ -208,6 +205,9 @@ class RegisteredUserController extends Controller 'description' => $request->description ]; + //send notification to user + $user->notify(new \App\Notifications\InstructorApplicant($application)); + // Create both application and instructor records Application::create($application); Instructors::create($instructor); diff --git a/app/Http/Controllers/student/BecomeInstructorController.php b/app/Http/Controllers/student/BecomeInstructorController.php index de82b18..eeaacaa 100644 --- a/app/Http/Controllers/student/BecomeInstructorController.php +++ b/app/Http/Controllers/student/BecomeInstructorController.php @@ -73,12 +73,6 @@ class BecomeInstructorController extends Controller DB::commit(); - // Get the latest application and send notification - $application = Application::max('id') + 1; - if ($application) { - $user->notify(new \App\Notifications\InstructorApplicant($application)); - } - Session::flash('success', get_phrase('Your application has been submitted successfully.')); return redirect(RouteServiceProvider::HOME); @@ -160,7 +154,7 @@ class BecomeInstructorController extends Controller Log::info('Instructor data to be saved:', $instructorData); // Prepare application data - INCLUDING DOCUMENT PATH - $applicationData = [ + $application = [ 'user_id' => $user->id, 'nidn' => $nidn, 'phone' => $request->phone, @@ -169,10 +163,13 @@ class BecomeInstructorController extends Controller 'status' => 0 ]; - Log::info('Application data to be saved:', $applicationData); + //send notification to user + $user->notify(new \App\Notifications\InstructorApplicant($application)); + + Log::info('Application data to be saved:', $application); // Create both application and instructor records - Application::create($applicationData); + Application::create($application); Instructors::create($instructorData); return redirect()->back(); // This return won't be used due to the try-catch structure diff --git a/app/Notifications/InstructorApplicant.php b/app/Notifications/InstructorApplicant.php index 57490b8..fd90c23 100644 --- a/app/Notifications/InstructorApplicant.php +++ b/app/Notifications/InstructorApplicant.php @@ -37,7 +37,7 @@ class InstructorApplicant extends Notification public function toMail(object $notifiable): MailMessage { return (new MailMessage) - ->subject(get_phrase('Instructor Application Approved') . ' - ' . config('app.name')) + ->subject(get_phrase('Instructor Application Submitted') . ' - ' . config('app.name')) ->view('vendor.notifications.instructor_applicant', [ 'user' => $notifiable, 'application' => $this->application diff --git a/public/assets/frontend/default/css/style.css b/public/assets/frontend/default/css/style.css index 6fb0874..51989b9 100644 --- a/public/assets/frontend/default/css/style.css +++ b/public/assets/frontend/default/css/style.css @@ -428,7 +428,7 @@ img { } .eBtn { - border: none; + border: white 2px solid; padding: 12px 30px; border-radius: 10px; color: #fff; @@ -444,10 +444,12 @@ img { } .eBtn:hover { - border: 1px solid; + border: var(--color-1) 2px solid !important; + text-decoration: none; + border-color: var(--color-1); background-position: right center; border-color: var(--color-1); - transform: translateY(-2px); + transform: translateY(-1px); color: #333 !important; box-shadow: 0 6px 20px rgba(2, 25, 110, 0.25); } diff --git a/resources/views/vendor/notifications/instructor_applicant.php b/resources/views/vendor/notifications/instructor_applicant.php index ea2871c..78133a5 100644 --- a/resources/views/vendor/notifications/instructor_applicant.php +++ b/resources/views/vendor/notifications/instructor_applicant.php @@ -88,7 +88,13 @@
{{ get_phrase('Application Details') }}:
{{ get_phrase('Application ID') }}: {{ $application->id }}
-{{ get_phrase('Submission Date') }}: {{ $application->created_at->format('F d, Y') }}
+{{ get_phrase('Submission Date') }}: + @if(method_exists($application->created_at, 'format')) + {{ $application->created_at->format('F d, Y') }} + @else + {{ date('F d, Y') }} + @endif +
{{ get_phrase('Current Status') }}: {{ get_phrase('Under Review') }}