public static function getScored(User $user, FormDefinition $form) { try { $submissions = new Collection(); $scores = Scores::where('form_definition_id', $form->id)->where('user_id', $user->id)->get(); foreach ($scores as $score) { $submissions->push($score->submission()->first()); } return $submissions; } catch (\Exception $e) { return new Collection(); } }