'dashboard', 'domains/admission/seo.admission-schedule.title' => 'admission-schedules.index', '{admissionTrack.name} {term.name}' => ''], context: 'admissionSchedule')] class extends Component { use HasLayoutDataAttributes; use HasSeoAttributes; use WithToast; #[Locked] public string $id; public function mount($id): void { $this->id = $id; } #[Computed] public function admissionSchedule(): AdmissionSchedule { return AdmissionSchedule::with(['admissionTrack', 'term']) ->where('ulid', $this->id)->first(); } #[Computed] public function studyPrograms(): Collection { return StudyProgram::all(['id', 'name', 'ulid']); } #[Computed] public function academicPrograms(): Collection { return AcademicProgram::all(['id', 'name', 'ulid']); } #[Computed] public function feeTypes(): Collection { return FeeType::all(['id', 'name', 'ulid']); } #[Computed] public function feeRates(): Collection { return FeeRate::where('admission_schedule_id', $this->admissionSchedule->id) ->get(); } public function updateFee(string $feeTypeId, string $programId, string $studyId, int $value, SetUpAdmissionFeeRates $setUpAdmissionFeeRates): true { $feeType = $this->feeTypes->where('ulid', $feeTypeId)->first(); $program = $this->academicPrograms->where('ulid', $programId)->first(); $study = $this->studyPrograms->where('ulid', $studyId)->first(); $setUpAdmissionFeeRates->execute(new AdmissionFeeRatesDTO( academicProgramId: $program->id, admissionScheduleId: $this->admissionSchedule->id, studyProgramId: $study->id, feeTypeId: $feeType->id, amount: $value )); $this->success(__('ui.crud.success.updated', ['resource' => __('ui.fee_type')])); $this->dispatch('$refresh'); return true; } };