diff --git a/app/Filament/Admin/Resources/InternApplications/InternApplicationResource.php b/app/Filament/Admin/Resources/InternApplications/InternApplicationResource.php
index fca75f2..ecdafc7 100644
--- a/app/Filament/Admin/Resources/InternApplications/InternApplicationResource.php
+++ b/app/Filament/Admin/Resources/InternApplications/InternApplicationResource.php
@@ -203,12 +203,22 @@ class InternApplicationResource extends Resource
foreach ($days as $d) {
$dayNum = $d['day_number'];
$dateF = $d['formatted_date'];
- $content = isset($saved[$dayNum]) ? $saved[$dayNum]->content : '';
+ $entry = $saved->get($dayNum);
+ $content = $entry ? $entry->content : '';
+ $isRetro = $entry ? $entry->is_retroactive : false;
+ $updatedAt = $entry ? $entry->updated_at->format('d.m.Y H:i') : null;
$html .= '
';
$html .= '
';
$html .= ' ' . $dayNum . '. Gün Raporu';
- $html .= ' ' . $dateF . '';
+ if ($isRetro) {
+ $html .= ' GERİYE DÖNÜK KAYIT';
+ }
+ if ($updatedAt) {
+ $html .= ' Son Güncelleme: ' . $updatedAt . '';
+ } else {
+ $html .= ' ' . $dateF . '';
+ }
$html .= '
';
$html .= '
' . ($content ? e($content) : 'Rapor yazılmamış') . '
';
$html .= '
';
diff --git a/app/Http/Controllers/CareerController.php b/app/Http/Controllers/CareerController.php
index 91b4785..627b265 100644
--- a/app/Http/Controllers/CareerController.php
+++ b/app/Http/Controllers/CareerController.php
@@ -472,21 +472,32 @@ class CareerController extends Controller
]);
$dateObj = \Carbon\Carbon::parse($request->date);
+
+ // 1. Prevent future entries
+ if ($dateObj->isFuture()) {
+ return response()->json(['success' => false, 'message' => 'İleriye dönük staj günleri için defter doldurulamaz.'], 422);
+ }
+
+ // 2. Prevent weekend entries
if ($dateObj->isWeekend()) {
return response()->json(['success' => false, 'message' => 'Hafta sonu günlerine staj günlüğü girilemez.'], 422);
}
+ // 3. Determine if retroactive
+ $isRetroactive = $dateObj->lt(\Carbon\Carbon::today());
+
$entry = \App\Models\InternshipJournalEntry::updateOrCreate([
'career_application_id' => $intern->id,
'day_number' => $request->day_number,
'date' => $request->date,
], [
'content' => $request->content,
+ 'is_retroactive' => $isRetroactive,
]);
return response()->json([
'success' => true,
- 'message' => $request->day_number . '. Gün kaydı başarıyla kaydedildi.',
+ 'message' => $request->day_number . '. Gün kaydı başarıyla kaydedildi.' . ($isRetroactive ? ' (Geriye Dönük Kayıt)' : ''),
'entry' => $entry
]);
}
diff --git a/app/Models/InternshipJournalEntry.php b/app/Models/InternshipJournalEntry.php
index dbbb949..8afa936 100644
--- a/app/Models/InternshipJournalEntry.php
+++ b/app/Models/InternshipJournalEntry.php
@@ -14,6 +14,11 @@ class InternshipJournalEntry extends Model
'day_number',
'date',
'content',
+ 'is_retroactive',
+ ];
+
+ protected $casts = [
+ 'is_retroactive' => 'boolean',
];
/**
diff --git a/database/migrations/2026_07_01_180002_add_retroactive_fields_to_internship_journal_entries.php b/database/migrations/2026_07_01_180002_add_retroactive_fields_to_internship_journal_entries.php
new file mode 100644
index 0000000..c0169d6
--- /dev/null
+++ b/database/migrations/2026_07_01_180002_add_retroactive_fields_to_internship_journal_entries.php
@@ -0,0 +1,28 @@
+boolean('is_retroactive')->default(false);
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::table('internship_journal_entries', function (Blueprint $table) {
+ $table->dropColumn('is_retroactive');
+ });
+ }
+};
diff --git a/resources/views/front/career/intern_dashboard.blade.php b/resources/views/front/career/intern_dashboard.blade.php
index a8bcfca..dc57a8a 100644
--- a/resources/views/front/career/intern_dashboard.blade.php
+++ b/resources/views/front/career/intern_dashboard.blade.php
@@ -722,14 +722,20 @@
-
+
+ Bu staj günü henüz gerçekleşmediği için staj günlüğü yazılamaz veya düzenlenemez.
+
+
+
@@ -789,6 +795,8 @@
@push('styles')
+
+