diff --git a/app/Filament/Admin/Resources/InternApplications/InternApplicationResource.php b/app/Filament/Admin/Resources/InternApplications/InternApplicationResource.php index 6df8774..71abce1 100644 --- a/app/Filament/Admin/Resources/InternApplications/InternApplicationResource.php +++ b/app/Filament/Admin/Resources/InternApplications/InternApplicationResource.php @@ -107,13 +107,16 @@ class InternApplicationResource extends Resource TextInput::make('username') ->label('Kullanıcı Adı') - ->unique(ignoreRecord: true) - ->nullable(), + ->default(fn ($record) => $record?->email) + ->disabled() + ->dehydrated() + ->autocomplete('new-username'), TextInput::make('password') ->label('Şifre') ->password() ->revealable() + ->autocomplete('new-password') ->formatStateUsing(fn () => null) ->dehydrateStateUsing(fn ($state) => filled($state) ? Hash::make($state) : null) ->dehydrated(fn ($state) => filled($state)) diff --git a/app/Models/CareerApplication.php b/app/Models/CareerApplication.php index f217ade..120f58a 100644 --- a/app/Models/CareerApplication.php +++ b/app/Models/CareerApplication.php @@ -37,11 +37,14 @@ class CareerApplication extends Model protected static function booted() { static::saving(function ($model) { - if ($model->type === 'internship' && !$model->certificate_code) { - do { - $code = 'TRN-' . date('Y') . '-' . strtoupper(\Illuminate\Support\Str::random(4)) . '-' . strtoupper(\Illuminate\Support\Str::random(4)); - } while (static::where('certificate_code', $code)->exists()); - $model->certificate_code = $code; + if ($model->type === 'internship') { + $model->username = $model->email; + if (!$model->certificate_code) { + do { + $code = 'TRN-' . date('Y') . '-' . strtoupper(\Illuminate\Support\Str::random(4)) . '-' . strtoupper(\Illuminate\Support\Str::random(4)); + } while (static::where('certificate_code', $code)->exists()); + $model->certificate_code = $code; + } } }); } diff --git a/resources/views/front/career/intern_dashboard.blade.php b/resources/views/front/career/intern_dashboard.blade.php index 829db8b..80d349a 100644 --- a/resources/views/front/career/intern_dashboard.blade.php +++ b/resources/views/front/career/intern_dashboard.blade.php @@ -495,27 +495,15 @@
@if($intern->to_be_signed_internship_form_path) - + Görüntüle - @if(!$intern->signed_internship_form_path) - - @endif - @else - @endif
- @if(!$intern->signed_internship_form_path) -
+
@csrf @@ -576,11 +564,11 @@
- + status !== 'pending') disabled @endif class="w-full px-4 py-3 rounded-xl border border-slate-200 focus:border-blue-400 focus:ring-1 focus:ring-blue-400 focus:outline-none text-sm font-semibold text-slate-700 bg-white transition-all disabled:bg-slate-50 disabled:text-slate-500 disabled:cursor-not-allowed" />
- + status !== 'pending') disabled @endif class="w-full px-4 py-3 rounded-xl border border-slate-200 focus:border-blue-400 focus:ring-1 focus:ring-blue-400 focus:outline-none text-sm font-semibold text-slate-700 bg-white transition-all disabled:bg-slate-50 disabled:text-slate-500 disabled:cursor-not-allowed" />
@@ -589,6 +577,7 @@
+ @if($intern->status === 'pending')
@@ -603,9 +592,13 @@ Dosyayı Kaydet
+ @else +
+ Başvurunuz bekleme aşamasında (beklemede) olmadığı için staj bilgilerinizi ve dosyanızı güncelleyemezsiniz. +
+ @endif
- @endif