diff --git a/app/Filament/Admin/Resources/CareerApplications/Schemas/CareerApplicationForm.php b/app/Filament/Admin/Resources/CareerApplications/Schemas/CareerApplicationForm.php index 1b98e15..5e76b3f 100644 --- a/app/Filament/Admin/Resources/CareerApplications/Schemas/CareerApplicationForm.php +++ b/app/Filament/Admin/Resources/CareerApplications/Schemas/CareerApplicationForm.php @@ -6,7 +6,9 @@ use Filament\Forms\Components\FileUpload; use Filament\Forms\Components\Select; use Filament\Forms\Components\Textarea; use Filament\Forms\Components\TextInput; +use Filament\Forms\Components\Section; use Filament\Schemas\Schema; +use Illuminate\Support\Facades\Hash; class CareerApplicationForm { @@ -34,7 +36,8 @@ class CareerApplicationForm ->disk('public') ->directory('cvs') ->required() - ->disabled(), + ->disabled() + ->downloadable(), Textarea::make('message') ->label(__('career.message')) @@ -50,6 +53,32 @@ class CareerApplicationForm 'accepted' => 'Accepted', ]) ->required(), + + Section::make('Stajyer Giriş Bilgileri & Belgeleri') + ->description('Stajyerin sisteme giriş yapabilmesi için kullanıcı adı, şifre belirleyin ve imzalı staj formunu yükleyin.') + ->collapsible() + ->schema([ + TextInput::make('username') + ->label('Kullanıcı Adı') + ->unique(ignoreRecord: true) + ->nullable(), + + TextInput::make('password') + ->label('Şifre') + ->password() + ->dehydrateStateUsing(fn ($state) => filled($state) ? Hash::make($state) : null) + ->dehydrated(fn ($state) => filled($state)) + ->placeholder('Şifreyi değiştirmek istemiyorsanız boş bırakın') + ->nullable(), + + FileUpload::make('signed_internship_form_path') + ->label('İmzalı Staj Formu') + ->disk('public') + ->directory('signed_interns') + ->downloadable() + ->nullable(), + ]) + ->columnSpanFull(), ]); } } diff --git a/app/Filament/Admin/Resources/CareerApplications/Tables/CareerApplicationsTable.php b/app/Filament/Admin/Resources/CareerApplications/Tables/CareerApplicationsTable.php index 581a0de..da47a36 100644 --- a/app/Filament/Admin/Resources/CareerApplications/Tables/CareerApplicationsTable.php +++ b/app/Filament/Admin/Resources/CareerApplications/Tables/CareerApplicationsTable.php @@ -91,6 +91,12 @@ class CareerApplicationsTable ->icon('heroicon-o-arrow-down-tray') ->url(fn ($record) => Storage::disk('public')->url($record->cv_path)) ->openUrlInNewTab(), + Action::make('download_signed_form') + ->label('İmzalı Form İndir') + ->icon('heroicon-o-document-check') + ->url(fn ($record) => $record->signed_internship_form_path ? Storage::disk('public')->url($record->signed_internship_form_path) : null) + ->visible(fn ($record) => !empty($record->signed_internship_form_path)) + ->openUrlInNewTab(), Action::make('download_nda') ->label(__('career.nda')) ->icon('heroicon-o-shield-check') diff --git a/app/Http/Controllers/CareerController.php b/app/Http/Controllers/CareerController.php index c0658ff..4f9eff5 100644 --- a/app/Http/Controllers/CareerController.php +++ b/app/Http/Controllers/CareerController.php @@ -74,4 +74,63 @@ class CareerController extends Controller return redirect()->back()->with('success', __('career.success_message')); } + + public function internLoginForm() + { + if (session()->has('intern_id')) { + return redirect()->route('intern.dashboard'); + } + return view('front.career.intern_login', [ + 'meta' => [ + 'title' => 'Stajyer Girişi', + 'description' => 'İmzalı staj belgelerinize erişmek için lütfen giriş yapın.', + ] + ]); + } + + public function internLogin(Request $request) + { + $request->validate([ + 'username' => 'required|string', + 'password' => 'required|string', + ]); + + $intern = CareerApplication::where('username', $request->username) + ->where('type', 'internship') + ->first(); + + if (!$intern || !\Illuminate\Support\Facades\Hash::check($request->password, $intern->password)) { + return redirect()->back() + ->withInput($request->only('username')) + ->withErrors([ + 'username' => 'Girdiğiniz kullanıcı adı veya şifre hatalı.', + ]); + } + + session(['intern_id' => $intern->id]); + + return redirect()->route('intern.dashboard')->with('success', 'Başarıyla giriş yapıldı.'); + } + + public function internDashboard() + { + if (!session()->has('intern_id')) { + return redirect()->route('intern.login')->with('error', 'Lütfen giriş yapın.'); + } + + $intern = CareerApplication::findOrFail(session('intern_id')); + return view('front.career.intern_dashboard', [ + 'intern' => $intern, + 'meta' => [ + 'title' => 'Stajyer Paneli', + 'description' => 'Belgelerinizi buradan indirebilirsiniz.', + ] + ]); + } + + public function internLogout() + { + session()->forget('intern_id'); + return redirect()->route('intern.login')->with('success', 'Başarıyla çıkış yapıldı.'); + } } diff --git a/app/Models/CareerApplication.php b/app/Models/CareerApplication.php index 39c09a7..20ff4bb 100644 --- a/app/Models/CareerApplication.php +++ b/app/Models/CareerApplication.php @@ -21,5 +21,20 @@ class CareerApplication extends Model 'ai_usage', 'message', 'status', + 'username', + 'password', + 'signed_internship_form_path', ]; + + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + 'password' => 'hashed', + ]; + } } diff --git a/database/migrations/2026_05_26_150000_add_intern_auth_fields_to_career_applications_table.php b/database/migrations/2026_05_26_150000_add_intern_auth_fields_to_career_applications_table.php new file mode 100644 index 0000000..fcfa25a --- /dev/null +++ b/database/migrations/2026_05_26_150000_add_intern_auth_fields_to_career_applications_table.php @@ -0,0 +1,30 @@ +string('username')->nullable()->unique()->after('status'); + $table->string('password')->nullable()->after('username'); + $table->string('signed_internship_form_path')->nullable()->after('password'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('career_applications', function (Blueprint $table) { + $table->dropColumn(['username', 'password', 'signed_internship_form_path']); + }); + } +}; diff --git a/resources/views/front/career/intern_dashboard.blade.php b/resources/views/front/career/intern_dashboard.blade.php new file mode 100644 index 0000000..6934597 --- /dev/null +++ b/resources/views/front/career/intern_dashboard.blade.php @@ -0,0 +1,137 @@ +@extends('layouts.site') + +@section('content') +
+
+
+ + +
+
+ Stajyer Paneli +

Hoş Geldiniz, {{ $intern->name }}

+

Staj belgelerinizi ve başvuru detaylarınızı buradan yönetebilirsiniz.

+
+
+ @csrf + +
+
+ + +
+ + +
+
+

Başvuru Detayları

+ +
+
+ E-posta + {{ $intern->email }} +
+ + @if($intern->phone) +
+ Telefon + {{ $intern->phone }} +
+ @endif + +
+ Staj Durumu + + @if($intern->status === 'accepted') Kabul Edildi + @elseif($intern->status === 'rejected') Reddedildi + @elseif($intern->status === 'reviewed') İncelendi + @else Beklemede @endif + +
+
+
+
+ + +
+
+

Belgeleriniz

+ +
+ + +
+
+
+ +
+
+

Özgeçmiş (CV)

+

Başvuru sırasında yüklemiş olduğunuz özgeçmiş belgeniz.

+
+
+ @if($intern->cv_path) + + + İndir + + @else + Yüklenmemiş + @endif +
+ + +
+
+
+ +
+
+

İmzalı Staj Formu

+ @if($intern->signed_internship_form_path) +

Şirketimiz tarafından imzalanmış ve onaylanmış staj belgeniz.

+ @else +

Belgeniz imza aşamasındadır. Yöneticilerimiz tarafından onaylandığında buradan indirebilirsiniz.

+ @endif +
+
+ + @if($intern->signed_internship_form_path) + + + İndir + + @else + + @endif +
+ +
+
+
+ +
+ +
+
+
+ +@push('styles') + + +@endpush +@endsection diff --git a/resources/views/front/career/intern_login.blade.php b/resources/views/front/career/intern_login.blade.php new file mode 100644 index 0000000..612b119 --- /dev/null +++ b/resources/views/front/career/intern_login.blade.php @@ -0,0 +1,87 @@ +@extends('layouts.site') + +@section('content') +
+
+
+
+
+
+ +
+

Stajyer Girişi

+

İmzalı belgelerinize erişmek için kullanıcı adı ve şifrenizle giriş yapın.

+
+ + @if($errors->any()) +
+
+
+ +
+
+

+ {{ $errors->first() }} +

+
+
+
+ @endif + + @if(session('success')) +
+
+
+ +
+
+

+ {{ session('success') }} +

+
+
+
+ @endif + +
+ @csrf + +
+ +
+ + + + +
+
+ +
+ +
+ + + + +
+
+ + +
+
+
+
+
+ +@push('styles') + + +@endpush +@endsection diff --git a/routes/web.php b/routes/web.php index f9d1a9a..c98eae3 100644 --- a/routes/web.php +++ b/routes/web.php @@ -115,6 +115,12 @@ Route::get('/kariyer', [\App\Http\Controllers\CareerController::class, 'index']) Route::get('/staj-basvurusu', [\App\Http\Controllers\CareerController::class, 'internship'])->name('career.internship'); Route::post('/kariyer', [\App\Http\Controllers\CareerController::class, 'store'])->name('career.store'); +// Intern Portal +Route::get('/stajyer/giris', [\App\Http\Controllers\CareerController::class, 'internLoginForm'])->name('intern.login'); +Route::post('/stajyer/giris', [\App\Http\Controllers\CareerController::class, 'internLogin'])->name('intern.login.submit'); +Route::get('/stajyer/panel', [\App\Http\Controllers\CareerController::class, 'internDashboard'])->name('intern.dashboard'); +Route::post('/stajyer/cikis', [\App\Http\Controllers\CareerController::class, 'internLogout'])->name('intern.logout'); + // Payment Process Route::post('/payment/process', [\App\Http\Controllers\PaymentController::class, 'process'])->name('payment.process'); Route::any('/payment/success', [\App\Http\Controllers\PaymentController::class, 'success'])->name('payment.success');