public static function create_new_congregation($input) { $congregation = new Congregation(['name' => $input['name'], 'display_name' => $input['display_name'], 'code' => $input['code'], 'day' => $input['day'], 'time' => $input['time']]); $congregation->save(); return $congregation; }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $attendance = Attendance::get_attendance($id); $congregation = Congregation::get_congregation($attendance->congregation_id); $deleted_message = 'Attendance for "' . $congregation->name . '" on ' . $attendance->service_date . ' has been deleted successfully.'; Attendance::destroy_attendance($id); return redirect('attendances')->withSuccess($deleted_message); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $congregation = Congregation::get_congregation($id); $deleted_message = 'Congregation "' . $congregation->name . '" has been deleted successfully.'; Congregation::destroy_congregation($id); return redirect('congregations')->withSuccess($deleted_message); }
public function get($id) { $congregations = Congregation::find($id); return $congregations; }