Enhance internship application process: update InternshipsPageController to retrieve internships and validate application submissions, modify Internship model to include relationships, and implement dynamic application modals in views for internships and careers. Update Livewire configuration for improved file upload handling.
This commit is contained in:
@@ -3,8 +3,26 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use App\Models\InternshipApplication;
|
||||
|
||||
class Internship extends Model
|
||||
{
|
||||
//
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'title_description',
|
||||
'salary_per_month',
|
||||
'bullets',
|
||||
'location',
|
||||
'salary_currency',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'bullets' => 'array',
|
||||
];
|
||||
|
||||
public function applications(): HasMany
|
||||
{
|
||||
return $this->hasMany(InternshipApplication::class);
|
||||
}
|
||||
}
|
||||
|
||||
24
app/Models/InternshipApplication.php
Normal file
24
app/Models/InternshipApplication.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class InternshipApplication extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'internship_id',
|
||||
'name',
|
||||
'birthdate',
|
||||
'resume_file',
|
||||
'email',
|
||||
'phone_number',
|
||||
'cover_letter',
|
||||
];
|
||||
|
||||
public function internship(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Internship::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user