feat: add application type field to career applications and implement status filtering in admin panel
This commit is contained in:
@@ -31,6 +31,16 @@ class CareerApplicationsTable
|
||||
->label(__('career.phone'))
|
||||
->searchable(),
|
||||
|
||||
TextColumn::make('type')
|
||||
->label(__('career.type'))
|
||||
->badge()
|
||||
->color(fn (string $state): string => match ($state) {
|
||||
'job' => 'success',
|
||||
'internship' => 'warning',
|
||||
default => 'gray',
|
||||
})
|
||||
->formatStateUsing(fn (string $state): string => __("career.{$state}")),
|
||||
|
||||
TextColumn::make('status')
|
||||
->label(__('career.status'))
|
||||
->badge()
|
||||
@@ -56,6 +66,12 @@ class CareerApplicationsTable
|
||||
'rejected' => 'Rejected',
|
||||
'accepted' => 'Accepted',
|
||||
]),
|
||||
SelectFilter::make('type')
|
||||
->label(__('career.type'))
|
||||
->options([
|
||||
'job' => __('career.job'),
|
||||
'internship' => __('career.internship'),
|
||||
]),
|
||||
])
|
||||
->actions([
|
||||
Action::make('download_cv')
|
||||
|
||||
@@ -47,8 +47,9 @@ class CareerController extends Controller
|
||||
'name' => $request->name,
|
||||
'email' => $request->email,
|
||||
'phone' => $request->phone,
|
||||
'type' => $request->type ?? 'job',
|
||||
'cv_path' => $cvPath,
|
||||
'message' => ($request->type === 'internship' ? "[STAJ BAŞVURUSU] " : "") . $request->message,
|
||||
'message' => $request->message,
|
||||
'status' => 'pending',
|
||||
]);
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ class CareerApplication extends Model
|
||||
'name',
|
||||
'email',
|
||||
'phone',
|
||||
'type',
|
||||
'cv_path',
|
||||
'message',
|
||||
'status',
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('career_applications', function (Blueprint $table) {
|
||||
$table->string('type')->default('job')->after('phone'); // job, internship
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('career_applications', function (Blueprint $table) {
|
||||
$table->dropColumn('type');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -16,6 +16,9 @@ return [
|
||||
'cv' => 'Curriculum Vitae (CV)',
|
||||
'message' => 'Message',
|
||||
'status' => 'Status',
|
||||
'type' => 'Application Type',
|
||||
'job' => 'Job Application',
|
||||
'internship' => 'Internship Application',
|
||||
'submit' => 'Submit Application',
|
||||
'success_message' => 'Your application has been received successfully. Thank you.',
|
||||
'download_cv' => 'Download CV',
|
||||
|
||||
@@ -16,6 +16,9 @@ return [
|
||||
'cv' => 'Özgeçmiş (CV)',
|
||||
'message' => 'Mesaj',
|
||||
'status' => 'Durum',
|
||||
'type' => 'Başvuru Türü',
|
||||
'job' => 'İş Başvurusu',
|
||||
'internship' => 'Staj Başvurusu',
|
||||
'submit' => 'Başvuruyu Gönder',
|
||||
'success_message' => 'Başvurunuz başarıyla alındı. Teşekkür ederiz.',
|
||||
'download_cv' => 'CV İndir',
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
<form action="{{ route('career.store') }}" method="POST" enctype="multipart/form-data" class="career-form" id="career-application-form">
|
||||
@csrf
|
||||
<input type="hidden" name="type" value="job">
|
||||
|
||||
<!-- Personal Info Group -->
|
||||
<div class="row mb-8 align-items-center">
|
||||
|
||||
Reference in New Issue
Block a user