/** * @param int $profile_id * * @return \Seat\Web\Models\StandingsProfile */ public function standingsProfile(int $profile_id) : StandingsProfile { return StandingsProfile::with('standings')->where('id', $profile_id)->first(); }
/** * @param int $element_id * @param int $profile_id * * @return \Illuminate\Http\RedirectResponse */ public function getRemoveElementFromProfile(int $element_id, int $profile_id) { // Get the standings profile that will be updated. $standings_profile = StandingsProfile::find($profile_id); $standings_profile->standings()->find($element_id)->delete(); return redirect()->back()->with('success', 'Standing removed!'); }