where('follow_up_type','registration')->where('refrence_id',$id)->latest()->first(); } public static function getFollowUpCount($id) { return FollowUp::select('id','next_schedule','follow_up_name','follow_up_by','remarks')->where('follow_up_type','registration')->where('refrence_id',$id)->latest()->get(); } public function leadcategory() { return $this->belongsTo(LeadCategory::class); } public function campaign() { return $this->belongsTo(Campaign::class); } public function enroll($id) { return Student::select('id')->where('source_ref','registration')->where('ref_id',$id)->latest()->first(); } }