public function update(Request $request) { $doctors = doctors::wheredoc_id($request->get('doc_id'))->first(); $doctors->fill($request->all()); if ($doctors->save()) { return Redirect::back()->withFlash_message(['msg' => ' Doctor successfully edited', 'type' => 'success']); } return Redirect::back()->withFlash_message(['msg' => ' Edit Failed', 'type' => 'warning']); }
/** * Display a listing of the resource. * * @return Response */ public function index() { // $institutions = institutions::join('areas', 'areas.id', "=", "institution.area_id")->get(array('institution.id', 'institution.address', 'institution.name', 'institution.created_at', 'areas.name as area_name', 'areas.id as area_id')); $areas = area::join('users', 'areas.assigned_employee', "=", "users.id")->get(array('areas.id as id', 'users.id as userid', 'areas.name', 'areas.description', 'areas.created_at', 'users.fname', 'users.lname')); $doctors = doctors::orderBy('doc_name', 'asc')->get(); $doctorclasses = doctorclasses::all(); $users = User::whereposition('Medical Representative')->get(); return view('institutions', compact('institutions', 'areas', 'doctorclasses', 'doctors', 'users')); }
public function run() { DB::table('doctors')->delete(); doctors::create(['doc_name' => 'ARROSAS, JULIE ROSE', 'specialization_id_fk' => '13', 'birthday' => '', 'contact_number' => '', 'prc_license' => '', 'email' => '', 'is_active' => '1']); doctors::create(['doc_name' => 'LATAYAN, MICHAEL JONATHAN', 'specialization_id_fk' => '16', 'birthday' => '', 'contact_number' => '', 'prc_license' => '', 'email' => '', 'is_active' => '0']); doctors::create(['doc_name' => 'DALMACIO, ELISA', 'specialization_id_fk' => '16', 'birthday' => '', 'contact_number' => '', 'prc_license' => '', 'email' => '', 'is_active' => '1']); doctors::create(['doc_name' => 'DAYANGHIRANG, CHONA', 'specialization_id_fk' => '3', 'birthday' => '', 'contact_number' => '', 'prc_license' => '', 'email' => '', 'is_active' => '1']); doctors::create(['doc_name' => 'ZAMORAS, CATHERINE', 'specialization_id_fk' => '3', 'birthday' => '', 'contact_number' => '', 'prc_license' => '', 'email' => '', 'is_active' => '0']); doctors::create(['doc_name' => 'ESPINO, VICTOR', 'specialization_id_fk' => '6', 'birthday' => '', 'contact_number' => '', 'prc_license' => '', 'email' => '', 'is_active' => '1']); doctors::create(['doc_name' => 'GUILLERMO, SYRIL BREN', 'specialization_id_fk' => '13', 'birthday' => '', 'contact_number' => '', 'prc_license' => '', 'email' => '', 'is_active' => '0']); doctors::create(['doc_name' => 'LOBATON, RICHARD', 'specialization_id_fk' => '6', 'birthday' => '', 'contact_number' => '', 'prc_license' => '', 'email' => '', 'is_active' => '1']); }