model && isset($this->model->os_id)) { // First get the current OS to find its group $currentOs = $this->osRepositoryInterface->find($this->model->os_id); if($currentOs && $currentOs->os_group_id) { // Then get all OS versions in the same group $os_versions = $this->osRepositoryInterface->filter( [ 'os_group_id' => $currentOs->os_group_id ], [], [], ['id', 'version'] ); } } return view('components.module.os-version', [ 'os_versions' => $os_versions, 'os' => $this->os, 'model' => $this->model ]); } }