/** * Store a newly created resource in storage. * * @return Response */ public function store() { $input = Input::all(); Log::info($input); $userdata['error'] = false; $validation = Validator::make($input, Appointment::$rules); if ($validation->passes()) { $data['date'] = $input['date']; $data['doctor_id'] = $input['doctor_id']; $data['patient_id'] = $input['patient_id']; $data['patient_encounter_form_id'] = null; $data['appointment_status'] = $input['appointment_status']; $dta['chief_complaint'] = $input['chief_complaint']; $dta['summary_of_illness'] = $input['summary_of_illness']; $app = $this->appointment->create($data); $dta['appointment_id'] = $app->id; $pef = $this->patientencounterform->create($dta); $app->patient_encounter_form_id = $pef->id; $app->save(); $userdata['message'] = "Appointment successfully created."; } else { $mess = ""; $messages = $validation->messages(); foreach ($messages->all() as $message) { $mess .= $message; } $userdata['message'] = $mess; $userdata['error'] = true; } return $userdata; }
/** * Store a newly created appointment in storage. * * @return Response */ public function store() { $validator = Validator::make($data = Input::all(), Appointment::$rules); if ($validator->fails()) { return Redirect::back()->withErrors($validator)->withInput(); } $data['time'] = Timeslot::findOrFail($data['timeslot_id'])->slot; Appointment::create($data); return Redirect::route('appointments.index'); }
public function makeAppointment() { $doctor_id = Input::get('doctor_id'); $clinic_id = Input::get('clinic_id'); $name = Input::get('name'); $email = Input::get('email'); $time = Input::get('time'); $phone = Input::get('phone'); $description = Input::get('description'); $otp = $this->generateOtp(); $appointment = Appointment::create(['doctor_id' => $doctor_id, 'clinic_id' => $clinic_id, 'email' => $email, 'name' => $name, 'appointment_time' => $time, 'phone' => $phone, 'description' => $description, 'otp' => $otp]); return Response::data($appointment); }
public function run() { User::create(['id' => 1, 'cedula' => '1014777780', 'name' => 'Administrador', 'password' => \Hash::make('1014777780'), 'email' => 'admin@mansion_mascota.com', 'phone' => '2621244', 'type' => 'admin']); User::create(['id' => 2, 'cedula' => '0812757578', 'name' => 'Usuario de pruebas', 'password' => \Hash::make('0812757578'), 'email' => 'test@mansion_mascota.com', 'phone' => '2621244', 'type' => 'admin']); $faker = Faker::create(); foreach (range(1, 10) as $index) { $user = User::create(['cedula' => $faker->randomNumber(10), 'name' => $faker->name, 'password' => \Hash::make('123456'), 'email' => $faker->email, 'phone' => $faker->phoneNumber, 'type' => 'user']); foreach (range(1, $faker->numberBetween(1, 2)) as $date) { $pet = Pet::create(['user_id' => $user->id, 'name' => $faker->firstName(), 'type' => $faker->randomElement(['perro', 'gato', 'pajaro', 'otro'])]); } foreach (range(1, $faker->numberBetween(1, 3)) as $date) { Appointment::create(['user_id' => $user->id, 'pet_id' => $pet->id, 'date' => $faker->dateTimeBetween('now', '+3 months'), 'note' => $faker->text(100 + $faker->numberBetween(10, 150))]); } } }
public static function addAppointment($customerID) { $info = Session::get('appointmentInfo'); Appointment::create(array('customer_id' => $customerID, 'appointment_type' => $info['package_id'], 'appointment_datetime' => $info['datetime'])); }
public function run() { $dt_start = Carbon::now(); $dt_end = Carbon::now(); $dt_start->year(2014)->month(12)->day(4)->hour(9)->minute(0)->second(0); $dt_end->year(2014)->month(12)->day(4)->hour(9)->minute(30)->second(0); Appointment::create(array('category_id' => '1', 'start' => $dt_start, 'end' => $dt_end)); $dt_start->year(2014)->month(12)->day(2)->hour(13)->minute(0)->second(0); $dt_end->year(2014)->month(12)->day(2)->hour(14)->minute(0)->second(0); Appointment::create(array('category_id' => '3', 'start' => $dt_start, 'end' => $dt_end)); }
public function add($name) { $this->agenda->addAppointment(Appointment::create()); $this->current()->setAppointmentName($name); return $this; }