/** * 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('doctorclasses')->delete(); doctorclasses::create(['name' => 'All Class', 'max_visit' => '0']); doctorclasses::create(['name' => 'Class A', 'max_visit' => '4']); doctorclasses::create(['name' => 'CLASS B', 'max_visit' => '2']); doctorclasses::create(['name' => 'CLASS C', 'max_visit' => '2']); doctorclasses::create(['name' => 'Generic', 'max_visit' => '15']); doctorclasses::create(['name' => 'Attendance', 'max_visit' => '15']); }