Example #1
0
 public function getAllTherapistTreatments($therapistId)
 {
     $treatments = Treatment::where('therapist_id', '=', $therapistId);
     return $treatments;
 }
 public static function forSearchTerm($search_term)
 {
     return Treatment::where('name', 'LIKE', '%' . $search_term . '%')->orderBy('created_at', 'asc')->get();
 }
Example #3
0
 public function getFavouriteChartingTreatments()
 {
     $treatments = new Collection();
     $ids = DB::table('user_favourite_treatments')->select('treatment_id')->where('user_id', $this->id)->orderBy('created_at', 'desc')->get();
     foreach ($ids as $id) {
         if (Treatment::where('id', $id->treatment_id)->count() > 0) {
             $treatment = Treatment::findOrFail($id->treatment_id);
             $treatments->push($treatment);
         }
     }
     return $treatments;
 }