Get record in custom page

I've made a custom view page where i want to display a table.

In v2 i had this code:
  
protected function getViewData(): array
{
    $data = $this->record->WorkoutExercises()->get();

    return compact('data');
}
  
public function mount($record): void
{
    $this->record = TrainingProgram::find($record);
}


and it still work, but i can see it's deprecated.

How would we do it in v3?
Was this page helpful?