- Created new module for CostCalculator with necessary routes and controllers. - Implemented views for creating, editing, and displaying costs. - Added form partials for cost input with validation. - Integrated living status options in the form. - Developed frontend logic for cost calculation steps with dynamic UI updates. - Included necessary assets (JS and SCSS) for styling and functionality. - Updated constants for living status options. - Enhanced existing client-side cost calculator page with new features.
45 lines
1.1 KiB
PHP
45 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Modules\CostCalculator\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Modules\CCMS\Models\Country;
|
|
use Modules\CourseFinder\Models\Program;
|
|
use Modules\CourseFinder\Models\ProgramLevel;
|
|
|
|
// use Modules\CostCalculator\Database\Factories\CostCalculatorFactory;
|
|
|
|
class CostCalculator extends Model
|
|
{
|
|
use HasFactory;
|
|
use \Staudenmeir\EloquentJsonRelations\HasJsonRelationships;
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*/
|
|
protected $guarded = [];
|
|
|
|
protected $casts = [
|
|
'living_cost' => 'object',
|
|
'accomodation_cost' => 'object',
|
|
'onetime_cost' => 'object',
|
|
'other_services' => 'object',
|
|
];
|
|
|
|
public function institution()
|
|
{
|
|
return $this->belongsTo(Country::class, 'country_id');
|
|
}
|
|
|
|
public function programLevel()
|
|
{
|
|
return $this->belongsTo(ProgramLevel::class, 'programlevel_id');
|
|
}
|
|
|
|
public function program()
|
|
{
|
|
return $this->belongsTo(Program::class, 'program_id');
|
|
}
|
|
}
|