Laravel Query Table join

I am Using Laravel Query to build a relation between tables. and it’s working fine.
Here is the code

public function mount($students)

{

  

  $students = Student::Join('fee_scheems', 'fee_scheems.fs_id', '=', 'students.stu_fee_scheem_id')

  ->Join('individually_fee_scheems', 'individually_fee_scheems.id', '=', 'students.stu_ind_fee_scheem_id')

  ->Join('fee_masters', 'fee_masters.fee_master_ind_fee_scheem_id', '=', 'individually_fee_scheems.id')

  ->Join('fee_groups', 'fee_groups.fg_id', '=', 'fee_masters.fee_master_fg_id')

  ->Join('school_fee_collectors', 'school_fee_collectors.fc_fg_id', '=', 'fee_groups.fg_id')

  ->where('students.stu_id', $students)

  ->get();

  $this->students = $students;

}

When I try to click the Edit function my join table data despair.

Here is my Here is my edit dunction code

public function edit($fm_id)

{

    $this->updateMode = true;

    $user = FeeMaster::where('fm_id',$fm_id)->first();

    $this->fc_fg_id = $fm_id;

    // $this->fc_fm_id = $user->fc_fm_id; 

}

how to I solve This

why are you using mount method? I see you have a $students parameter but it’s overrides by query. Maybe you have to move this to the render method and in every re-render the $this->student property can be reload and get the changes properly.