public function alertIndex($petId) { $pet = Pet::find($petId); $alerts = Alert::getAlertsByPetId($petId)->paginate(10); return view('alert.index', compact('pet', 'alerts')); }