change in cost calculation

This commit is contained in:
2025-08-15 18:01:35 +05:45
parent 5e0913b9f9
commit 6d6d1c9a8a
9 changed files with 2549 additions and 2877 deletions

View File

@@ -8,6 +8,7 @@ use Modules\CCMS\Models\Country;
use Modules\CourseFinder\Models\Program;
use Modules\CourseFinder\Models\ProgramLevel;
use Modules\CostCalculator\Models\StayType;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
// use Modules\CostCalculator\Database\Factories\CostCalculatorFactory;
@@ -30,16 +31,6 @@ class CostCalculator extends Model
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');
}
public function stayTypeLiving(): BelongsToMany
{
return $this->belongsToMany(StayType::class, 'living_costs', 'cost_calculator_id', 'stay_type_id')->withPivot('id', 'monthly', 'yearly')->withTimestamps();