public function edit($id)
 {
     $user = User::find($id);
     $specializations = DoctorsSpecialization::lists('name', 'id');
     $data = ['user' => $user, 'specializations' => $specializations];
     return view('frontend.management.edit-doctor', $data);
 }
Пример #2
0
 /**
  * @param  $id
  * @throws GeneralException
  * @return \Illuminate\Support\Collection|null|static
  */
 public function findOrThrowException($id)
 {
     $user = User::find($id);
     if (!is_null($user)) {
         return $user;
     }
     throw new GeneralException('Acest utilizator nu exista.');
 }
Пример #3
0
 /**
  * @param $id
  * @return \Illuminate\Support\Collection|null|static
  * @throws GeneralException
  */
 public function findOrThrowException($id)
 {
     $user = User::find($id);
     if (!is_null($user)) {
         return $user;
     }
     throw new GeneralException('That user does not exist.');
 }
Пример #4
0
 /**
  * Set up tests.
  */
 public function setUp()
 {
     parent::setUp();
     // Set up the database
     Artisan::call('migrate:refresh');
     Artisan::call('db:seed');
     // Run the tests in English
     App::setLocale('en');
     /**
      * Create class properties to be used in tests
      */
     $this->admin = User::find(1);
     $this->executive = User::find(2);
     $this->user = User::find(3);
     $this->adminRole = Role::find(1);
     $this->executiveRole = Role::find(2);
     $this->userRole = Role::find(3);
 }
 public function saveConversations(ConversationRequest $request)
 {
     $patient = User::find($request->doctorID);
     $conversation = new Conversation();
     $conversation->message = $request->message;
     $conversation->doctor_id = auth()->user()->id;
     $conversation->patient_id = $patient->id;
     $conversation->report_id = $request->reportId;
     $conversation->doctor_name = $patient->name;
     $conversation->sender = auth()->user()->id;
     $conversation->save();
     return redirect()->back();
 }