From 0d31ea3bac505a40d55d40b5ddfe249daa096129 Mon Sep 17 00:00:00 2001 From: baghizadizn Date: Tue, 2 Dec 2025 04:24:01 +0000 Subject: [PATCH] notifikasi email instruktur --- .../Auth/RegisteredUserController.php | 230 +++++++++------ .../Auth/VerifyEmailController.php | 69 +---- .../student/BecomeInstructorController.php | 261 ++++++++++-------- app/Notifications/InstructorApplicant.php | 8 +- .../admin/setting/system_setting.blade.php | 4 +- .../views/auth/forgot-password.blade.php | 2 +- resources/views/auth/register.blade.php | 37 ++- .../student/become_instructor/index.blade.php | 10 +- ...ant.php => instructor_applicant.blade.php} | 26 +- .../instructor_approval.blade.php | 125 +++++++-- 10 files changed, 480 insertions(+), 292 deletions(-) rename resources/views/vendor/notifications/{instructor_applicant.php => instructor_applicant.blade.php} (83%) diff --git a/app/Http/Controllers/Auth/RegisteredUserController.php b/app/Http/Controllers/Auth/RegisteredUserController.php index 9978c91..e926307 100644 --- a/app/Http/Controllers/Auth/RegisteredUserController.php +++ b/app/Http/Controllers/Auth/RegisteredUserController.php @@ -67,12 +67,14 @@ class RegisteredUserController extends Controller $instructorValidator = Validator::make($request->all(), [ 'nidn' => ['required', 'string', 'max:11'], 'phone' => ['required', 'string'], + 'description' => ['nullable', 'string', 'max:1000'], 'document' => ['required', 'file', 'mimes:pdf,doc,docx', 'max:2048'], ], [ 'nidn.required' => get_phrase('NIDN is required'), 'nidn.string' => get_phrase('NIDN must be a valid number'), 'nidn.max' => get_phrase('NIDN may not be greater than 11 characters'), 'phone.required' => get_phrase('Phone number is required'), + 'description.max' => get_phrase('Description may not be greater than 1000 characters'), 'document.required' => get_phrase('Document is required'), 'document.file' => get_phrase('Document must be a valid file'), 'document.mimes' => get_phrase('Document must be PDF, DOC, or DOCX'), @@ -100,23 +102,39 @@ class RegisteredUserController extends Controller 'password' => Hash::make($request->password), ]; - if (get_settings('student_email_verification') != 1) { - $user_data['email_verified_at'] = Carbon::now(); - } + // Don't set email_verified_at here yet - only set it after everything succeeds + // This prevents sending verification email if registration fails $user = User::create($user_data); - event(new Registered($user)); - + // If applying as an instructor, process the application - if ($request->has('instructor')) { + if ($request->has('instructor') && $request->instructor == 1) { $result = $this->processInstructorApplication($request, $user); + + // Check if result is a RedirectResponse with error if ($result instanceof RedirectResponse && $result->getSession()->get('error')) { - // If there was an error in instructor application, rollback DB::rollBack(); return $result; } + + // If result is a success response (true), continue with commit + if ($result !== true) { + DB::rollBack(); + Session::flash('error', get_phrase('Error during registration. Please try again.')); + return redirect()->back()->withInput(); + } } + // Now that everything succeeded, set email_verified_at if needed + if (get_settings('student_email_verification') != 1) { + $user->email_verified_at = Carbon::now(); + $user->save(); // Save the update + } + + // Fire the Registered event AFTER everything is committed + // This ensures email is only sent when registration is fully successful + event(new Registered($user)); + DB::commit(); // Log the user in after successful registration @@ -129,90 +147,136 @@ class RegisteredUserController extends Controller DB::rollBack(); } - Log::error('Registration error:', ['error' => $e->getMessage()]); + Log::error('Registration error:', [ + 'error' => $e->getMessage(), + 'trace' => $e->getTraceAsString(), + 'request' => $request->except(['password', 'document']) + ]); + Session::flash('error', get_phrase('Error during registration. Please try again.')); return redirect()->back()->withInput(); } } - private function processInstructorApplication(Request $request, User $user): RedirectResponse + private function processInstructorApplication(Request $request, User $user) { - // Check if application already exists - if (Application::where('user_id', $user->id)->exists()) { - Session::flash('error', get_phrase('Your request is in process. Please wait for admin to respond.')); - return redirect()->route('become.instructor'); - } + try { + // Check if application already exists + if (Application::where('user_id', $user->id)->exists()) { + Session::flash('error', get_phrase('Your request is in process. Please wait for admin to respond.')); + return redirect()->back()->withInput(); + } - // Check if NIDN already exists in Instructors table with status = 1 (active) - $nidn = $request->nidn; - $existingInstructor = Instructors::where('nidn', $nidn) - ->where('status', 1) - ->first(); + // Check if NIDN already exists in Instructors table with status = 1 (active) + $nidn = $request->nidn; + $existingInstructor = Instructors::where('nidn', $nidn) + ->where('status', 1) + ->first(); - if ($existingInstructor) { - Session::flash('error', get_phrase('This NIDN is already registered as an active instructor.')); + if ($existingInstructor) { + Session::flash('error', get_phrase('This NIDN is already registered as an active instructor.')); + return redirect()->back()->withInput(); + } + + // Check NIDN with the API + $api_url = "https://sindig.unesa.ac.id/apipddikti/api?nidn={$nidn}&auto=1"; + + Log::info('Calling API for NIDN: ' . $nidn); + + $response = Http::timeout(30)->get($api_url); + + if (!$response->successful()) { + Log::error('API request failed', [ + 'status' => $response->status(), + 'body' => $response->body() + ]); + Session::flash('error', get_phrase('Unable to verify NIDN. Please try again later.')); + return redirect()->back()->withInput(); + } + + $data = $response->json(); + Log::info('API Response for NIDN: ' . $nidn, ['response' => $data]); + + if (!isset($data['ok']) || $data['ok'] !== true || !isset($data['matched_dosen']) || count($data['matched_dosen']) == 0) { + Session::flash('error', get_phrase('NIDN not found in the system. Please check your NIDN.')); + return redirect()->back()->withInput(); + } + + // Extract matched dosen data + $matched_dosen = $data['matched_dosen'][0]; + + if (strtolower(trim($matched_dosen['nama'])) != strtolower(trim($user->name))) { + Log::warning('Name mismatch', [ + 'api_name' => $matched_dosen['nama'], + 'user_name' => $user->name + ]); + Session::flash('error', get_phrase('Name does not match PDDikti records. Please check your name.')); + return redirect()->back()->withInput(); + } + + // Upload document + $fileName = null; + if ($request->hasFile('document') && $request->file('document')->isValid()) { + $doc = $request->file('document'); + $fileName = 'uploads/applications/' . $user->id . '_' . time() . '_' . Str::random(10) . '.' . $doc->getClientOriginalExtension(); + + $uploadResult = FileUploader::upload($doc, $fileName, null, null, 300); + + if (!$uploadResult) { + Session::flash('error', get_phrase('Document upload failed. Please try again.')); + return redirect()->back()->withInput(); + } + } else { + Session::flash('error', get_phrase('Document upload failed or no document selected.')); + return redirect()->back()->withInput(); + } + + // Prepare instructor data + $instructor = [ + 'user_id' => $user->id, + 'nidn' => $nidn, + 'name' => $matched_dosen['nama'] ?? $user->name, + 'id_sdm' => $matched_dosen['id'] ?? null, + 'id_sms' => $matched_dosen['nama_prodi'] ?? null, + 'id_pt' => $matched_dosen['nama_pt'] ?? null, + 'status' => 0 + ]; + + Log::info('Creating instructor record:', $instructor); + + // Prepare application data + $application = [ + 'user_id' => $user->id, + 'phone' => $request->phone, + 'description' => $request->description ?? null, + 'document' => $fileName, + 'status' => 0 + ]; + + // Create both application and instructor records + $applicationRecord = Application::create($application); + Instructors::create($instructor); + + // Send notification to user + try { + $user->notify(new \App\Notifications\InstructorApplicant($applicationRecord)); + } catch (\Exception $e) { + Log::error('Failed to send notification:', ['error' => $e->getMessage()]); + // Don't fail registration if notification fails + } + + // Return true to indicate success + return true; + + } catch (\Exception $e) { + Log::error('Instructor application processing error:', [ + 'error' => $e->getMessage(), + 'trace' => $e->getTraceAsString(), + 'user_id' => $user->id ?? null + ]); + + Session::flash('error', get_phrase('Error processing instructor application. Please try again.')); return redirect()->back()->withInput(); } - - // Check NIDN with the API - $api_url = "https://sindig.unesa.ac.id/apipddikti/api?nidn={$nidn}&auto=1"; - - $response = Http::timeout(30)->get($api_url); - $data = $response->json(); - - Log::info('API Response for NIDN: ' . $nidn, ['response' => $data]); - - // Extract matched dosen data - $matched_dosen = $data['matched_dosen'][0]; - Log::info('Instructor data to be saved:', $matched_dosen); - - if (!isset($data['ok']) || !isset($data['matched_dosen']) || count($data['matched_dosen']) == 0) { - Session::flash('error', get_phrase('NIDN not found in the system. Please check your NIDN.')); - return redirect()->back()->withInput(); - } else if (strtolower($matched_dosen['nama']) != strtolower($user->name)) { - Session::flash('error', get_phrase('Name does not match PDDikti records. Please check your name.')); - return redirect()->back()->withInput(); - } - - // Prepare instructor data - adjust fields according to your database - $instructor = [ - 'user_id' => $user->id, - 'nidn' => $nidn, - 'name' => $matched_dosen['nama'] ?? $user->name, - 'id_sdm' => $matched_dosen['id'] ?? null, - 'id_sms' => $matched_dosen['nama_prodi'] ?? null, - 'id_pt' => $matched_dosen['nama_pt'] ?? null, - 'status' => 0 - ]; - - Log::info('Instructor data to be saved:', $instructor); - - // Upload document - if ($request->hasFile('document') && $request->file('document')->isValid()) { - $doc = $request->file('document'); - $fileName = 'uploads/applications/' . $user->id . Str::random(20) . '.' . $doc->extension(); - - FileUploader::upload($doc, $fileName, null, null, 300); - } else { - Session::flash('error', 'Document upload failed or no document selected.'); - return redirect()->back()->withInput(); - } - - // Prepare application data - $application = [ - 'user_id' => $user->id, - 'phone' => $request->phone, - '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); - - Session::flash('success', get_phrase('Your application has been submitted successfully.')); - return redirect(RouteServiceProvider::HOME); } -} +} \ No newline at end of file diff --git a/app/Http/Controllers/Auth/VerifyEmailController.php b/app/Http/Controllers/Auth/VerifyEmailController.php index 4ce54f3..1b368dc 100644 --- a/app/Http/Controllers/Auth/VerifyEmailController.php +++ b/app/Http/Controllers/Auth/VerifyEmailController.php @@ -1,46 +1,5 @@ user()->hasVerifiedEmail()) { -// return redirect()->intended(RouteServiceProvider::HOME . '?verified=1'); -// } - -// if ($request->user()->markEmailAsVerified()) { -// event(new Verified($request->user())); -// } - -// return redirect()->intended(RouteServiceProvider::HOME . '?verified=1'); -// } -// } - - - - - - - - - - - - - - - namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; @@ -56,33 +15,29 @@ class VerifyEmailController extends Controller /** * Mark the authenticated user's email address as verified. */ - public function __construct(Type $var = null) { - $this->var = $var; - $user = User::findOrFail(request()->route('id')); - Auth::login($user); - } public function __invoke(EmailVerificationRequest $request): RedirectResponse { - // Fetch the user directly from the database using the route parameters - $user = Auth::user(); - - - // Validate the hash matches the user's email - if (!hash_equals((string) $request->route('hash'), sha1($user->getEmailForVerification()))) { - abort(403, 'Invalid or expired verification link.'); + // If you need to manually handle user authentication, do it here + // But note: Laravel should already handle this with EmailVerificationRequest + + $user = $request->user(); + + if (!$user) { + // Fallback: try to get user from route parameters if not authenticated + $user = User::find($request->route('id')); + if ($user) { + Auth::login($user); + } } if ($user->hasVerifiedEmail()) { return redirect()->intended(RouteServiceProvider::HOME . '?verified=1'); } - // Mark email as verified and trigger the Verified event if ($user->markEmailAsVerified()) { event(new Verified($user)); } - // Optionally log the user in after successful verification - return redirect()->intended(RouteServiceProvider::HOME . '?verified=1'); } -} +} \ No newline at end of file diff --git a/app/Http/Controllers/student/BecomeInstructorController.php b/app/Http/Controllers/student/BecomeInstructorController.php index eeaacaa..a494660 100644 --- a/app/Http/Controllers/student/BecomeInstructorController.php +++ b/app/Http/Controllers/student/BecomeInstructorController.php @@ -8,14 +8,13 @@ use App\Models\FileUploader; use App\Models\Instructors; use App\Models\User; use Illuminate\Http\Request; -use Illuminate\Http\RedirectResponse; -use App\Providers\RouteServiceProvider; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; use Illuminate\Support\Str; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Cache; class BecomeInstructorController extends Controller { @@ -27,151 +26,183 @@ class BecomeInstructorController extends Controller public function store(Request $request) { - // Check if application already exists - if (Application::where('user_id', auth()->user()->id)->exists()) { - Session::flash('error', get_phrase('Your request is in process. Please wait for admin to response.')); - return redirect()->route('become.instructor'); - } - - $rules = [ - 'nidn' => ['required', 'string', 'max:11'], - 'phone' => 'required', - 'document' => ['required', 'file', 'mimes:pdf,doc,docx', 'max:2048'], - 'description' => 'required', - ]; - - // Validate data - $validator = Validator::make($request->all(), $rules, [ - 'nidn.required' => get_phrase('NIDN is required'), - 'nidn.string' => get_phrase('NIDN must be a valid number'), - 'nidn.max' => get_phrase('NIDN may not be greater than 11 characters'), - 'phone.required' => get_phrase('Phone number is required'), - 'document.required' => get_phrase('Document is required'), - 'document.file' => get_phrase('Document must be a valid file'), - 'document.mimes' => get_phrase('Document must be PDF, DOC, or DOCX'), - 'document.max' => get_phrase('Document size must be less than 2MB'), - 'description.required' => get_phrase('Description is required'), - ]); - - if ($validator->fails()) { - $firstError = $validator->errors()->first(); - Session::flash('error', $firstError); - return redirect()->back()->withErrors($validator)->withInput(); - } - $user = auth()->user(); - + + // Use a lock to prevent race conditions + $lock = Cache::lock('instructor_application_' . $user->id, 10); + + if (!$lock->get()) { + Session::flash('error', get_phrase('Another request is being processed. Please try again.')); + return redirect()->back(); + } + try { + // Check if application already exists + if (Application::where('user_id', $user->id)->exists()) { + Session::flash('error', get_phrase('Your request is in process. Please wait for admin to response.')); + return redirect()->route('become.instructor'); + } + + $rules = [ + 'nidn' => ['required', 'string', 'max:11'], + 'phone' => 'required', + 'document' => ['required', 'file', 'mimes:pdf,doc,docx', 'max:2048'], + 'description' => 'required', + ]; + + // Validate data + $validator = Validator::make($request->all(), $rules, [ + 'nidn.required' => get_phrase('NIDN is required'), + 'nidn.string' => get_phrase('NIDN must be a valid number'), + 'nidn.max' => get_phrase('NIDN may not be greater than 11 characters'), + 'phone.required' => get_phrase('Phone number is required'), + 'document.required' => get_phrase('Document is required'), + 'document.file' => get_phrase('Document must be a valid file'), + 'document.mimes' => get_phrase('Document must be PDF, DOC, or DOCX'), + 'document.max' => get_phrase('Document size must be less than 2MB'), + 'description.required' => get_phrase('Description is required'), + ]); + + if ($validator->fails()) { + $firstError = $validator->errors()->first(); + Session::flash('error', $firstError); + return redirect()->back()->withErrors($validator)->withInput(); + } + DB::beginTransaction(); $result = $this->processInstructorApplication($request, $user); - if ($result instanceof RedirectResponse && $result->getSession()->get('error')) { + if ($result['success'] === false) { DB::rollBack(); - return $result; + Session::flash('error', $result['error']); + return redirect()->back()->withInput(); } DB::commit(); Session::flash('success', get_phrase('Your application has been submitted successfully.')); - return redirect(RouteServiceProvider::HOME); + return redirect()->route('home'); // Use named route instead of service provider } catch (\Exception $e) { DB::rollBack(); - Log::error('Instructor application error:', ['error' => $e->getMessage()]); + Log::error('Instructor application error:', [ + 'error' => $e->getMessage(), + 'trace' => $e->getTraceAsString(), + 'user_id' => $user->id + ]); Session::flash('error', get_phrase('Error during application submission. Please try again.')); return redirect()->back()->withInput(); + } finally { + $lock->release(); } } - private function processInstructorApplication(Request $request, User $user): RedirectResponse + private function processInstructorApplication(Request $request, User $user) { - // Check if application already exists (redundant but safe) - if (Application::where('user_id', $user->id)->exists()) { - Session::flash('error', get_phrase('Your request is in process. Please wait for admin to respond.')); - return redirect()->route('become.instructor'); - } - - // Check if NIDN already exists in Instructors table with status = 1 (active) $nidn = $request->nidn; + + // Check if NIDN already exists in Instructors table with status = 1 (active) $existingInstructor = Instructors::where('nidn', $nidn) ->where('status', 1) ->first(); if ($existingInstructor) { - Session::flash('error', get_phrase('This NIDN is already registered as an active instructor.')); - return redirect()->back()->withInput(); + return ['success' => false, 'error' => get_phrase('This NIDN is already registered as an active instructor.')]; } // Check NIDN with the API $api_url = "https://sindig.unesa.ac.id/apipddikti/api?nidn={$nidn}&auto=1"; - $response = Http::timeout(30)->get($api_url); - $data = $response->json(); - - Log::info('API Response for NIDN: ' . $nidn, ['response' => $data]); - - // Extract matched dosen data - $matched_dosen = $data['matched_dosen'][0]; - Log::info('Instructor data to be saved:', $matched_dosen); - - if (!isset($data['ok']) || !isset($data['matched_dosen']) || count($data['matched_dosen']) == 0) { - Session::flash('error', get_phrase('NIDN not found in the system. Please check your NIDN.')); - return redirect()->back()->withInput(); - } else if (strtolower($matched_dosen['nama']) != strtolower($user->name)) { - Session::flash('error', get_phrase('Name does not match PDDikti records. Please check your name.')); - return redirect()->back()->withInput(); - } - - // Upload document - $fileName = null; - if ($request->hasFile('document') && $request->file('document')->isValid()) { - $doc = $request->file('document'); - $fileName = 'uploads/applications/' . $user->id . Str::random(20) . '.' . $doc->getClientOriginalExtension(); - - $uploadResult = FileUploader::upload($doc, $fileName, null, null, 300); - - if (!$uploadResult) { - Session::flash('error', get_phrase('Document upload failed. Please try again.')); - return redirect()->back()->withInput(); + Log::info('Calling API for NIDN: ' . $nidn); + + try { + $response = Http::timeout(30)->get($api_url); + + if (!$response->successful()) { + Log::error('API request failed', [ + 'status' => $response->status(), + 'body' => $response->body() + ]); + return ['success' => false, 'error' => get_phrase('Unable to verify NIDN. Please try again later.')]; } - } else { - Session::flash('error', get_phrase('Document upload failed or no document selected.')); - return redirect()->back()->withInput(); + + $data = $response->json(); + + if (!isset($data['ok']) || $data['ok'] !== true || !isset($data['matched_dosen']) || !is_array($data['matched_dosen']) || count($data['matched_dosen']) == 0) { + return ['success' => false, 'error' => get_phrase('NIDN not found in the system. Please check your NIDN.')]; + } + + // Extract matched dosen data + $matched_dosen = $data['matched_dosen'][0]; + + if (!isset($matched_dosen['nama'])) { + Log::error('API response missing nama field', ['response' => $matched_dosen]); + return ['success' => false, 'error' => get_phrase('Invalid API response. Please try again later.')]; + } + + if (strtolower(trim($matched_dosen['nama'])) != strtolower(trim($user->name))) { + Log::warning('Name mismatch', [ + 'api_name' => $matched_dosen['nama'], + 'user_name' => $user->name + ]); + return ['success' => false, 'error' => get_phrase('Name does not match PDDikti records. Please check your name.')]; + } + + // Upload document + $doc = $request->file('document'); + $fileName = 'uploads/applications/' . $user->id . '_' . time() . '_' . Str::random(10) . '.' . $doc->getClientOriginalExtension(); + + $uploadResult = FileUploader::upload($doc, $fileName, null, null, 300); + + if (!$uploadResult) { + return ['success' => false, 'error' => get_phrase('Document upload failed. Please try again.')]; + } + + // Prepare instructor data + $instructor = [ + 'user_id' => $user->id, + 'nidn' => $nidn, + 'name' => $matched_dosen['nama'] ?? $user->name, + 'id_sdm' => $matched_dosen['id'] ?? null, + 'id_sms' => $matched_dosen['nama_prodi'] ?? null, + 'id_pt' => $matched_dosen['nama_pt'] ?? null, + 'status' => 0 + ]; + + // Prepare application data + $application = [ + 'user_id' => $user->id, + 'phone' => $request->phone, + 'description' => $request->description, + 'document' => $fileName, + 'status' => 0 + ]; + + // Create both application and instructor records + $applicationRecord = Application::create($application); + Instructors::create($instructor); + + // Send notification to user + try { + $user->notify(new \App\Notifications\InstructorApplicant($applicationRecord)); + } catch (\Exception $e) { + Log::error('Failed to send notification:', [ + 'error' => $e->getMessage(), + 'user_id' => $user->id, + 'application_id' => $applicationRecord->id + ]); + } + + return ['success' => true, 'applicationRecord' => $applicationRecord]; + + } catch (\Exception $e) { + Log::error('Process instructor application error:', [ + 'error' => $e->getMessage(), + 'trace' => $e->getTraceAsString(), + 'user_id' => $user->id + ]); + return ['success' => false, 'error' => get_phrase('Error processing application. Please try again.')]; } - - // Prepare instructor data - $instructorData = [ - 'user_id' => $user->id, - 'nidn' => $nidn, - 'name' => $matched_dosen['nama'] ?? $user->name, - 'id_sdm' => $matched_dosen['id'] ?? null, - 'id_sms' => $matched_dosen['nama_prodi'] ?? null, - 'id_pt' => $matched_dosen['nama_pt'] ?? null, - 'status' => 0 - ]; - - Log::info('Instructor data to be saved:', $instructorData); - - // Prepare application data - INCLUDING DOCUMENT PATH - $application = [ - 'user_id' => $user->id, - 'nidn' => $nidn, - 'phone' => $request->phone, - 'description' => $request->description, - 'document' => $fileName, - 'status' => 0 - ]; - - //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($application); - Instructors::create($instructorData); - - return redirect()->back(); // This return won't be used due to the try-catch structure } -} +} \ No newline at end of file diff --git a/app/Notifications/InstructorApplicant.php b/app/Notifications/InstructorApplicant.php index fd90c23..9bcc3bd 100644 --- a/app/Notifications/InstructorApplicant.php +++ b/app/Notifications/InstructorApplicant.php @@ -18,9 +18,13 @@ class InstructorApplicant extends Notification */ public function __construct($application) { - $this->application = $application; + // Convert array to object if it's an array + if (is_array($application)) { + $this->application = (object) $application; + } else { + $this->application = $application; + } } - /** * Get the notification's delivery channels. * diff --git a/resources/views/admin/setting/system_setting.blade.php b/resources/views/admin/setting/system_setting.blade.php index 23d4474..210dc08 100644 --- a/resources/views/admin/setting/system_setting.blade.php +++ b/resources/views/admin/setting/system_setting.blade.php @@ -64,8 +64,8 @@
- - + +
diff --git a/resources/views/auth/forgot-password.blade.php b/resources/views/auth/forgot-password.blade.php index 2377c47..e775878 100644 --- a/resources/views/auth/forgot-password.blade.php +++ b/resources/views/auth/forgot-password.blade.php @@ -20,7 +20,7 @@

{{ get_phrase('Submit your account email address.') }}

- +
{{ get_phrase('Back to login page') }} diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 3f0c8f2..8c5368e 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -24,7 +24,7 @@

{{ get_phrase('See your growth and get consulting support! ') }}

- + @error('name') @@ -33,7 +33,7 @@
- + @error('email') @@ -42,7 +42,7 @@
- + @error('password') @@ -150,4 +150,35 @@ } } + @endpush diff --git a/resources/views/frontend/default/student/become_instructor/index.blade.php b/resources/views/frontend/default/student/become_instructor/index.blade.php index a7fea64..6e227d3 100644 --- a/resources/views/frontend/default/student/become_instructor/index.blade.php +++ b/resources/views/frontend/default/student/become_instructor/index.blade.php @@ -18,7 +18,7 @@
- + @error('nidn') {{ $message }} @enderror @@ -27,7 +27,7 @@
- + @error('phone') {{ $message }} @enderror @@ -36,7 +36,7 @@
- + @error('document') {{ $message }} @enderror @@ -45,8 +45,8 @@
- - + + @error('description') {{ $message }} @enderror diff --git a/resources/views/vendor/notifications/instructor_applicant.php b/resources/views/vendor/notifications/instructor_applicant.blade.php similarity index 83% rename from resources/views/vendor/notifications/instructor_applicant.php rename to resources/views/vendor/notifications/instructor_applicant.blade.php index 78133a5..b671332 100644 --- a/resources/views/vendor/notifications/instructor_applicant.php +++ b/resources/views/vendor/notifications/instructor_applicant.blade.php @@ -87,13 +87,22 @@

{{ get_phrase('Application Details') }}:

-

{{ get_phrase('Application ID') }}: {{ $application->id }}

+

{{ get_phrase('Application ID') }}: + @php + $applicationId = is_array($application) ? ($application['id'] ?? 'N/A') : ($application->id ?? 'N/A'); + echo $applicationId; + @endphp +

{{ get_phrase('Submission Date') }}: - @if(method_exists($application->created_at, 'format')) - {{ $application->created_at->format('F d, Y') }} - @else - {{ date('F d, Y') }} - @endif + @php + $createdAt = is_array($application) ? ($application['created_at'] ?? now()) : ($application->created_at ?? now()); + + if (is_object($createdAt) && method_exists($createdAt, 'format')) { + echo $createdAt->format('F d, Y'); + } else { + echo date('F d, Y', strtotime($createdAt)); + } + @endphp

{{ get_phrase('Current Status') }}: {{ get_phrase('Under Review') }} @@ -124,8 +133,9 @@

- + \ No newline at end of file diff --git a/resources/views/vendor/notifications/instructor_approval.blade.php b/resources/views/vendor/notifications/instructor_approval.blade.php index 85fbba6..8da2722 100644 --- a/resources/views/vendor/notifications/instructor_approval.blade.php +++ b/resources/views/vendor/notifications/instructor_approval.blade.php @@ -5,7 +5,6 @@ {{ get_phrase('Instructor Application Approved') }} @@ -64,17 +109,44 @@ {{ get_phrase('Instructor Application Approved') }}
- + \ No newline at end of file