public function testDestroyAppointment() { Session::start(); $newAppointment = new \App\Appointment(); $newAppointment->name = 'Martin Fowler'; $newAppointment->phoneNumber = '6692216251'; $newAppointment->when = '2015-07-24T18:00:00.000Z'; $newAppointment->notificationTime = '2015-07-24T17:45:00.000Z'; $newAppointment->timezoneOffset = '300'; $newAppointment->save(); $idToDelete = $newAppointment->id; $appointments = \App\Appointment::where(['name' => 'Martin Fowler'])->get(); $this->assertCount(1, $appointments); $this->call('DELETE', '/appointment/' . $idToDelete, ['_token' => csrf_token()]); $appointments = \App\Appointment::where(['name' => 'Martin Fowler'])->get(); $this->assertCount(0, $appointments); }
private function inputBusyDays($busy_days, $user_name) { $taken = []; foreach ($busy_days as $day) { // Find unique reasons $randi = rand(0, count($this->reasons) - 1); while (isset($taken[$randi])) { $randi = rand(0, count($this->reasons) - 1); } $taken[$randi] = true; $appointment = new \App\Appointment(); $appointment->day = $day; $appointment->user_id = \App\User::where('name', '=', $user_name)->first()->id; $appointment->reason = $this->reasons[$randi]; $appointment->save(); } }
<input type="text" onkeyup="get_patient_links(this)" autocomplete="off"><i class="fa fa-search"></i> <div class="suggestions"></div> </div> </div> </div> <div class="nav-item item-2" onclick="show_add_patient_dialog()"><img src="{{ url('images/quick-nav-2.jpg') }}" alt=""></div> <div class="nav-item item-3" onclick="$('.calendar-changer-sidebar').focus();"><img src="{{ url('images/quick-nav-3.jpg') }}" alt=""> <div class="calendar-flyout-sidebar"> <input type="text" class="calendar-changer-sidebar" onchange="setNewDate($(this).val())" value="@if(isset($date_start)){{ $date_start->format('d/m/Y') }}@else{{ \Carbon\Carbon::now()->format('d/m/Y') }}@endif" style="display: block; width: 1px; height: 1px; opacity: 0; padding: 0; border: 0; background: 0; position: absolute;"> </div> </div> <div class="nav-item item-4" onclick="toggleWaitingRoom()"> <img src="{{ url('images/quick-nav-4.jpg') }}" alt=""> <?php $waiting_room_count = 0; $waiting_room_count = App\Appointment::getWaitingRoomCount(); if ($waiting_room_count > 0) { ?> <div class="counter">{{ $waiting_room_count }}</div> <?php } ?> <div class="waiting-room-flyout"> @include('backend/partials/side-waiting-room') </div> </div> <div class="nav-item item-5"><img src="{{ url('images/quick-nav-5.jpg') }}" alt=""></div> <div class="nav-item item-6"> <img src="{{ url('images/quick-nav-6.jpg') }}" alt="" onclick="toggleNotes()"> <div class="notes-flyout"> @include('backend/partials/side-notes')