コード例 #1
0
 public function postAddAttendance(Request $request)
 {
     $volunteercol = \teambernieny\Volunteer::with('neighborhood')->where('id', '=', $request->volunteer_id)->get();
     $volunteer = $volunteercol->first();
     $this->saveVolunteer($request, $volunteer, $volunteer->neighborhood->id);
     $attendances = \teambernieny\EventVolunteers::where('event_id', '=', $request->event_id)->where('volunteer_id', '=', $request->volunteer_id)->get();
     if (sizeof($attendances) == 0) {
         $this->addAttendance($request, $volunteer);
         $message = 'Volunteer Attendance Added!';
     } else {
         $message = 'Whoops! Volunteer Attendance already added... try further down in the file';
     }
     return $this->returnCheck($request, $message);
 }
コード例 #2
0
 public function getAll(Request $request)
 {
     $volunteers = \teambernieny\Volunteer::with('neighborhood')->with('contactevents')->orderby('FirstName')->get();
     return view('volunteer.search.all')->with(['volunteers' => $volunteers]);
 }