本文整理汇总了PHP中Appointment::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Appointment::create方法的具体用法?PHP Appointment::create怎么用?PHP Appointment::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Appointment
的用法示例。
在下文中一共展示了Appointment::create方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
/**
* 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;
}
示例2: store
/**
* 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');
}
示例3: makeAppointment
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);
}
示例4: run
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))]);
}
}
}
示例5: addAppointment
public static function addAppointment($customerID)
{
$info = Session::get('appointmentInfo');
Appointment::create(array('customer_id' => $customerID, 'appointment_type' => $info['package_id'], 'appointment_datetime' => $info['datetime']));
}
示例6: run
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));
}
示例7: add
public function add($name)
{
$this->agenda->addAppointment(Appointment::create());
$this->current()->setAppointmentName($name);
return $this;
}