コード例 #1
0
 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function index()
 {
     $doctors = doctors::join('specializations', 'specializations.id', '=', 'doctors.specialization_id_fk')->where('is_active', '!=', '0')->get();
     $forapproval = doctors::join('specializations', 'specializations.id', '=', 'doctors.specialization_id_fk')->where('is_active', '=', '0')->get();
     $specializations = specializations::all();
     $institutions = institutions::all();
     return view('doctors', compact('doctors', 'forapproval', 'specializations', 'institutions'));
 }
コード例 #2
0
 public function run()
 {
     DB::table('institution')->delete();
     institutions::create(['name' => 'Davao Doctors Hospital', 'address' => 'Quirino, Davao City', 'area_id' => '1']);
     institutions::create(['name' => 'Tagum Doctors Hospital', 'address' => 'Tagum City', 'area_id' => '1']);
     institutions::create(['name' => 'Davao Seventh Day Adventist Hospital', 'address' => 'Bangkal, Davao City']);
     institutions::create(['name' => 'Digos Provincial Hospital', 'address' => 'Digos City', 'area_id' => '1']);
     institutions::create(['name' => 'Limso Hospital', 'address' => 'Ilustre St., Davao City', 'area_id' => '1']);
 }
コード例 #3
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update(Request $request)
 {
     $input = $request->all();
     $institution = institutions::whereid($request->get('id'))->first();
     $institution->fill($request->all());
     if ($institution->save()) {
         return Redirect::back()->withFlash_message(['msg' => ' Institution Updatd successfully', 'type' => 'success']);
     }
     return Redirect::back()->withFlash_message(['msg' => ' Edit Failed', 'type' => 'warning']);
 }