@@ -17,12 +17,12 @@ discard block |
||
17 | 17 | */ |
18 | 18 | public function index() |
19 | 19 | { |
20 | - $doctor = Doctor::orderBy('name','asc')->paginate(10); |
|
20 | + $doctor = Doctor::orderBy('name', 'asc')->paginate(10); |
|
21 | 21 | $data = [ |
22 | 22 | 'role' => session('role'), |
23 | 23 | 'doctor' => $doctor, |
24 | 24 | ]; |
25 | - return view('pages.doctor')->with('data',$data); |
|
25 | + return view('pages.doctor')->with('data', $data); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function store(Request $request) |
47 | 47 | { |
48 | - $this->validate($request,[ |
|
48 | + $this->validate($request, [ |
|
49 | 49 | 'specialty' => 'required', |
50 | 50 | 'name' => 'required|min:3|max:50', |
51 | 51 | 'license' => 'required|min:3|max:191', |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | $doctor->email = $request->input('email'); |
63 | 63 | $doctor->password = Hash::make($request->password); |
64 | 64 | |
65 | - if($doctor->save()) { |
|
66 | - return redirect (route('doctor.index'))->with('success', 'Berhasil Menambahkan Dokter !'); |
|
65 | + if ($doctor->save()) { |
|
66 | + return redirect(route('doctor.index'))->with('success', 'Berhasil Menambahkan Dokter !'); |
|
67 | 67 | } |
68 | 68 | |
69 | - return redirect (route('doctor.index'))->with('failed', 'Gagal menambah dokter !'); |
|
69 | + return redirect(route('doctor.index'))->with('failed', 'Gagal menambah dokter !'); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function update(Request $request, $id) |
108 | 108 | { |
109 | - $this->validate($request,[ |
|
109 | + $this->validate($request, [ |
|
110 | 110 | 'name' => 'required|min:3|max:50', |
111 | 111 | 'password' => 'required_with:password_confirmation|same:password_confirmation|min:6', |
112 | 112 | 'password_confirmation' => 'min:6' |
@@ -116,11 +116,11 @@ discard block |
||
116 | 116 | $doctor = Doctor::find($id); |
117 | 117 | $doctor->name = $request->input('name'); |
118 | 118 | $doctor->password = $pass; |
119 | - if($doctor->save()) { |
|
120 | - return redirect (route('doctor.index'))->with('success', 'Doktor berhasil di update !'); |
|
119 | + if ($doctor->save()) { |
|
120 | + return redirect(route('doctor.index'))->with('success', 'Doktor berhasil di update !'); |
|
121 | 121 | } |
122 | 122 | |
123 | - return redirect (route('doctor.edit', $id))->with('failed', 'Gagal memperbaharui dokter !'); |
|
123 | + return redirect(route('doctor.edit', $id))->with('failed', 'Gagal memperbaharui dokter !'); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | /** |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $doctor = Doctor::find($id); |
135 | 135 | $doctor->delete(); |
136 | 136 | |
137 | - return redirect (route('doctor.index')); |
|
137 | + return redirect(route('doctor.index')); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | } |