Passed
Pull Request — master (#70)
by
unknown
07:13
created
app/Common.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -17,22 +17,22 @@  discard block
 block discarded – undo
17 17
     {
18 18
         $log = new Log;
19 19
 
20
-        $log->action = $data['action'];
21
-        $log->target = $data['target'];
22
-        $log->prefix = $data['prefix'];
20
+        $log->action = $data[ 'action' ];
21
+        $log->target = $data[ 'target' ];
22
+        $log->prefix = $data[ 'prefix' ];
23 23
 
24
-        switch($data['target']) {
25
-            case 'thread'   : $log->thread_id = $data['target_id']; break;
26
-            case 'article'  : $log->article_id = $data['target_id']; break;
24
+        switch ($data[ 'target' ]) {
25
+            case 'thread'   : $log->thread_id = $data[ 'target_id' ]; break;
26
+            case 'article'  : $log->article_id = $data[ 'target_id' ]; break;
27 27
         }
28 28
 
29
-        switch ($data['actor']) {
30
-            case 'admin'    : $log->admin_id = $data['actor_id'];   break;
31
-            case 'doctor'   : $log->doctor_id = $data['actor_id'];  break;
32
-            case 'user'     : $log->user_id = $data['actor_id'];  break;
29
+        switch ($data[ 'actor' ]) {
30
+            case 'admin'    : $log->admin_id = $data[ 'actor_id' ]; break;
31
+            case 'doctor'   : $log->doctor_id = $data[ 'actor_id' ]; break;
32
+            case 'user'     : $log->user_id = $data[ 'actor_id' ]; break;
33 33
         }
34 34
 
35
-        if($log->save()) {
35
+        if ($log->save()) {
36 36
             return true;
37 37
         }
38 38
 
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
         $c = count($logs);
46 46
         $r = 0;
47 47
         foreach ($logs as $log) {
48
-            if($log->delete()) {
48
+            if ($log->delete()) {
49 49
                 $r++;
50 50
             }
51 51
         }
52
-        if($c == $r) {
52
+        if ($c == $r) {
53 53
             return true;
54 54
         }
55 55
         return false;
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
58 58
     private static function getLogs($data)
59 59
     {
60 60
         $logs = null;
61
-        if($data['target'] == 'thread') {
62
-            $logs = Log::where('thread_id', $data['target_id'])->get();
63
-        } elseif($data['target'] == 'article') {
64
-            $logs = Log::where('article_id', $data['target_id'])->get();
61
+        if ($data[ 'target' ] == 'thread') {
62
+            $logs = Log::where('thread_id', $data[ 'target_id' ])->get();
63
+        } elseif ($data[ 'target' ] == 'article') {
64
+            $logs = Log::where('article_id', $data[ 'target_id' ])->get();
65 65
         }
66 66
         return $logs;
67 67
     }
Please login to merge, or discard this patch.
app/Http/Controllers/ThreadAskController.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
12 12
 {
13 13
     public function __construct()
14 14
     {
15
-        $this->middleware('auth', ['except' => [
15
+        $this->middleware('auth', [ 'except' => [
16 16
             'index', 'show'
17
-        ]]);
17
+        ] ]);
18 18
     }
19 19
 
20 20
 
@@ -62,14 +62,14 @@  discard block
 block discarded – undo
62 62
 
63 63
         $topic = $this->addTopic($request->input('topic'));
64 64
 
65
-        if($topic != null) {
65
+        if ($topic != null) {
66 66
             $thread = new Thread;
67 67
             $thread->user_id = $this->currentUser()->id;
68 68
             $thread->id_topic = $topic->id;
69 69
             $thread->question = $request->input('question');
70 70
 
71 71
             $log = null;
72
-            if($thread->save()) {
72
+            if ($thread->save()) {
73 73
                 $log = Common::registerLog([
74 74
                     'action' => "membuat diskusi baru.",
75 75
                     'target' => 'thread',
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
                 ]);
81 81
             }
82 82
 
83
-            if($log != null && $log == true) {
83
+            if ($log != null && $log == true) {
84 84
                 return redirect(route('user.thread.index'))->with('success', 'Pertanyaan dikirim !');
85 85
             }
86 86
             return redirect()->back()->with('failed', 'Gagal mengirim pertanyaan, silahkan coba lagi nanti.');
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     public function show($id)
98 98
     {
99 99
         $thread = Thread::find($id);
100
-        if(!$thread) {
100
+        if (!$thread) {
101 101
             abort(404);
102 102
         }
103 103
 
@@ -119,11 +119,11 @@  discard block
 block discarded – undo
119 119
     {
120 120
         $user = $this->currentUser();
121 121
         $thread = Thread::find($id);
122
-        if($thread->user_id != $user->id) {
122
+        if ($thread->user_id != $user->id) {
123 123
             return redirect()->back()->with('warning', 'Anda tidak berhak mengakses laman tersebut.');
124 124
         }
125 125
 
126
-        if($thread->doctor_id != null) {
126
+        if ($thread->doctor_id != null) {
127 127
             return redirect()->back()->with('warning', 'Tidak dapat mengubah pertanyaan karena sudah terjawab, silahkan tanyakan pertanyaan baru.');
128 128
         }
129 129
         $threads = Thread::orderBy('created_at', 'desc')->paginate(5);
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
     {
149 149
         $user = $this->currentUser();
150 150
         $thread = Thread::find($id);
151
-        if($thread->user_id != $user->id) {
151
+        if ($thread->user_id != $user->id) {
152 152
             return redirect()->back()->with('warning', 'Anda tidak berhak mengubah ulasan tersebut.');
153 153
         }
154 154
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 
160 160
         $thread->topic = $request->input('topic');
161 161
         $thread->question = $request->input('question');
162
-        if($thread->save()) {
162
+        if ($thread->save()) {
163 163
             return redirect(route('user.thread.show', $thread->id))->with('success', 'Berhasil mengubah ulasan !');
164 164
         }
165 165
         return redirect(route('user.thread.show', $thread->id))->with('success', 'Berhasil mengubah ulasan !');
@@ -175,18 +175,18 @@  discard block
 block discarded – undo
175 175
     {
176 176
         $user = $this->currentUser();
177 177
         $thread = Thread::find($id);
178
-        if($thread->user_id != $user->id) {
178
+        if ($thread->user_id != $user->id) {
179 179
             return redirect()->back()->with('warning', 'Anda tidak berhak menghapus ulasan tersebut.');
180 180
         }
181 181
 
182 182
         $unreg = null;
183
-        if($thread->delete() && $this->deleteTopic($thread->id_topic)) {
183
+        if ($thread->delete() && $this->deleteTopic($thread->id_topic)) {
184 184
             $unreg = Common::unregisterLog([
185 185
                'target' => 'thread',
186 186
                'target_id' => $id
187 187
             ]);
188 188
         }
189
-        if($unreg != null && $unreg) {
189
+        if ($unreg != null && $unreg) {
190 190
             return redirect(route('user.profile'))->with('success', 'Ulasan dihapus !');
191 191
         }
192 192
         return redirect()->back()->with('failed', 'Gagal menghapus ulasan.');
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
     {
211 211
         $new = new ThreadTopic;
212 212
         $new->topic_name = $topic;
213
-        if($new->save()) {
213
+        if ($new->save()) {
214 214
             return $new;
215 215
         }
216 216
         return null;
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
     private function deleteTopic($id)
226 226
     {
227 227
         $topic = ThreadTopic::find($id);
228
-        if($topic->delete()) {
228
+        if ($topic->delete()) {
229 229
             return true;
230 230
         }
231 231
         return false;
Please login to merge, or discard this patch.
app/Http/Controllers/ArticleController.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
      */
16 16
     public function index()
17 17
     {
18
-        $articles = Articles::orderBy('category','asc')->paginate(15);
18
+        $articles = Articles::orderBy('category', 'asc')->paginate(15);
19 19
         $data = [
20 20
             'articles' => $articles
21 21
         ];
@@ -38,20 +38,20 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public function store(Request $request)
40 40
     {
41
-        $this->validate($request,[
41
+        $this->validate($request, [
42 42
             'category' => 'required',
43 43
             'title' => 'required',
44 44
             'content' => 'required|min:500',
45 45
             'cover_image' => 'image|nullable|max:3999'
46 46
         ]);
47 47
 
48
-        if($request->hasFile('cover_image')){
48
+        if ($request->hasFile('cover_image')) {
49 49
             $filenameWithExt = $request->file('cover_image')->getClientOriginalName();
50 50
             $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);
51 51
             $extension = $request->file('cover_image')->getClientOriginalExtension();
52 52
             $fileNameToStore = $filename.'_'.time().'.'.$extension;
53 53
             $path = $request->file('cover_image')->storeAs('public/cover_images', $fileNameToStore);
54
-        }else {
54
+        } else {
55 55
             $fileNameToStore = 'noimage.jpg';
56 56
         }
57 57
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $article->category = $request->input('category');
60 60
         $article->title = $request->input('title');
61 61
         $article->content = $request->input('content');
62
-        if(session('guard') == 'admin') {
62
+        if (session('guard') == 'admin') {
63 63
             $article->admin_id = Auth::guard('admin')->user()->id;
64 64
         } else {
65 65
             $article->doctor_id = Auth::guard('doctor')->user()->id;
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         $article->cover_image = $fileNameToStore;
68 68
 
69 69
         $log = null;
70
-        if($article->save()) {
70
+        if ($article->save()) {
71 71
             $log = Common::registerLog([
72 72
                 'action' => "membuat artikel baru.",
73 73
                 'target' => 'article',
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
             ]);
79 79
         }
80 80
 
81
-        if($log != null && $log == true) {
82
-            return redirect (route(session('guard').'.article.index'))->with('success', 'Artikel baru berhasil ditambahkan !');
81
+        if ($log != null && $log == true) {
82
+            return redirect(route(session('guard').'.article.index'))->with('success', 'Artikel baru berhasil ditambahkan !');
83 83
         }
84 84
 
85 85
         return redirect(route(session('guard').'.article.create'))->with('failed', 'Gagal menambahkan artikel.');
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     public function show($id)
93 93
     {
94 94
         $article = Articles::find($id);
95
-        if(!$article) {
95
+        if (!$article) {
96 96
             abort(404);
97 97
         }
98 98
         return view('pages.ext.view-article')->with('article', $article);
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         }
126 126
 
127 127
         $data = [
128
-            'articles' => Articles::where('category', $cat)->orderBy('title','asc')->get(),
128
+            'articles' => Articles::where('category', $cat)->orderBy('title', 'asc')->get(),
129 129
             'category' => $category,
130 130
             'cat' => $cat
131 131
         ];
@@ -156,8 +156,8 @@  discard block
 block discarded – undo
156 156
         }
157 157
             $data = [
158 158
                 'articles' => Articles::where('category', $cat)
159
-                                        ->where('title','LIKE',$name.'%')
160
-                                        ->orderBy('title','asc')
159
+                                        ->where('title', 'LIKE', $name.'%')
160
+                                        ->orderBy('title', 'asc')
161 161
                                         ->get(),
162 162
                 'category' => $category,
163 163
                 'cat' => $cat
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
     {
171 171
         $cari = $request->cari;
172 172
         $articles = Articles::where('category', $cat)
173
-                        ->where('content','LIKE','%'.$cari.'%')
174
-                        ->orderBy('title','asc')
173
+                        ->where('content', 'LIKE', '%'.$cari.'%')
174
+                        ->orderBy('title', 'asc')
175 175
                         ->get();
176 176
         $category = null;
177 177
         switch ($cat) {
@@ -207,11 +207,11 @@  discard block
 block discarded – undo
207 207
     public function edit($id)
208 208
     {
209 209
         $article = Articles::find($id);
210
-        if(!$article) {
210
+        if (!$article) {
211 211
             abort(404);
212 212
         }
213 213
 
214
-        if($article->writer()['data']->id != Auth::guard(session('guard'))->user()->id) {
214
+        if ($article->writer()[ 'data' ]->id != Auth::guard(session('guard'))->user()->id) {
215 215
             return redirect(session('guard').'/article')->with('warning', 'Anda tidak berhak untuk mengubah Artikel tersebut.');
216 216
         }
217 217
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
      */
230 230
     public function update(Request $request, $id)
231 231
     {
232
-        $this->validate($request,[
232
+        $this->validate($request, [
233 233
             'category' => 'required',
234 234
             'title' => 'required',
235 235
             'content' => 'required|min:500',
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 
238 238
         ]);
239 239
 
240
-        if($request->hasFile('cover_image')){
240
+        if ($request->hasFile('cover_image')) {
241 241
             $filenameWithExt = $request->file('cover_image')->getClientOriginalName();
242 242
             $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);
243 243
             $extension = $request->file('cover_image')->getClientOriginalExtension();
@@ -249,12 +249,12 @@  discard block
 block discarded – undo
249 249
         $article->category = $request->input('category');
250 250
         $article->title = $request->input('title');
251 251
         $article->content = $request->input('content');
252
-        if($request->hasFile('cover_image')){
252
+        if ($request->hasFile('cover_image')) {
253 253
             $article->cover_image = $fileNameToStore;
254 254
         }
255 255
 
256 256
         $log = null;
257
-        if($article->save()) {
257
+        if ($article->save()) {
258 258
             $log = Common::registerLog([
259 259
                 'action' => "membuat perubahan pada artikelnya.",
260 260
                 'target' => 'article',
@@ -265,11 +265,11 @@  discard block
 block discarded – undo
265 265
             ]);
266 266
         }
267 267
 
268
-        if($log != null && $log == true) {
269
-            return redirect (route(session('guard').'.article.index'))->with('success', 'Artikel berhasil diubah !');
268
+        if ($log != null && $log == true) {
269
+            return redirect(route(session('guard').'.article.index'))->with('success', 'Artikel berhasil diubah !');
270 270
         }
271 271
 
272
-        return redirect (route(session('guard').'.article.edit', $id))->with('failed', 'Gagal mengubah artikel !');
272
+        return redirect(route(session('guard').'.article.edit', $id))->with('failed', 'Gagal mengubah artikel !');
273 273
     }
274 274
 
275 275
     /**
@@ -280,18 +280,18 @@  discard block
 block discarded – undo
280 280
     {
281 281
         $article = Articles::find($id);
282 282
 
283
-        if($article->cover_image != 'noimage.jpg'){
283
+        if ($article->cover_image != 'noimage.jpg') {
284 284
             Storage::delete('public/cover_images/'.$article->cover_image);
285 285
         }
286 286
 
287 287
         $unreg = null;
288
-        if($article->delete()) {
288
+        if ($article->delete()) {
289 289
             $unreg = Common::unregisterLog([
290 290
                 'target' => 'article',
291 291
                 'target_id' => $id
292 292
             ]);
293 293
         }
294
-        if($unreg != null && $unreg) {
294
+        if ($unreg != null && $unreg) {
295 295
             return redirect()->back()->with('success', 'Artikel dihapus !');
296 296
         }
297 297
 
Please login to merge, or discard this patch.
app/Http/Controllers/ThreadController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@  discard block
 block discarded – undo
11 11
 {
12 12
     public function __construct()
13 13
     {
14
-        $this->middleware('auth:admin', ['except' => [
14
+        $this->middleware('auth:admin', [ 'except' => [
15 15
             'index', 'show'
16
-        ]]);
16
+        ] ]);
17 17
     }
18 18
 
19 19
     /**
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
     {
27 27
         $threads = null;
28 28
         $count = null;
29
-        if($query == "all") {
29
+        if ($query == "all") {
30 30
             $threads = Thread::orderBy('created_at', 'desc')->paginate(15);
31
-        } elseif($query == "answered") {
31
+        } elseif ($query == "answered") {
32 32
             $threads = Thread::where('status', true)
33 33
                             ->orderBy('created_at', 'desc')
34 34
                             ->paginate(15);
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     public function show($id)
62 62
     {
63 63
         $thread = Thread::find($id);
64
-        if(!$thread) {
64
+        if (!$thread) {
65 65
             abort(404);
66 66
         }
67 67
 
@@ -84,14 +84,14 @@  discard block
 block discarded – undo
84 84
     {
85 85
         $thread = Thread::find($id);
86 86
         $unreg = null;
87
-        if($thread->delete() && $this->deleteTopic($thread->id_topic)) {
87
+        if ($thread->delete() && $this->deleteTopic($thread->id_topic)) {
88 88
             $unreg = Common::unregisterLog([
89 89
                 'target' => 'thread',
90 90
                 'target_id' => $id
91 91
             ]);
92 92
         }
93
-        if($unreg != null && $unreg) {
94
-            return redirect(route('admin.thread.index', ['query' => "all"]))->with('success', 'Diskusi dihapus !');
93
+        if ($unreg != null && $unreg) {
94
+            return redirect(route('admin.thread.index', [ 'query' => "all" ]))->with('success', 'Diskusi dihapus !');
95 95
         }
96 96
         return redirect()->back()->with('failed', 'Gagal menghapus diskusi.');
97 97
     }
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     public function deleteTopic($id)
107 107
     {
108 108
         $topic = ThreadTopic::find($id);
109
-        if($topic->delete()) {
109
+        if ($topic->delete()) {
110 110
             return true;
111 111
         }
112 112
         return false;
Please login to merge, or discard this patch.
app/Http/Controllers/HospitalController.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -17,12 +17,12 @@  discard block
 block discarded – undo
17 17
      */
18 18
     public function index()
19 19
     {
20
-        $hospital = Hospital::orderBy('city_id','asc')->paginate(10);
20
+        $hospital = Hospital::orderBy('city_id', 'asc')->paginate(10);
21 21
         $data = [
22 22
             'role' => session('role'),
23 23
             'hospital' => $hospital
24 24
         ];
25
-        return view('pages.hospital')->with('data',$data);
25
+        return view('pages.hospital')->with('data', $data);
26 26
     }
27 27
 
28 28
     /**
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
         $hospital->public_services = $request->input('public_services');
64 64
         $hospital->cover_images_id = 1;
65 65
 
66
-        if($hospital->save()) {
67
-            return redirect (route('hospital.index'))->with('success', 'Rumah sakit berhasil di tambahkan !');
66
+        if ($hospital->save()) {
67
+            return redirect(route('hospital.index'))->with('success', 'Rumah sakit berhasil di tambahkan !');
68 68
         }
69 69
 
70
-        return redirect (route('hospital.index'))->with('failed', 'Gagal menambahkan rumah sakit !');
70
+        return redirect(route('hospital.index'))->with('failed', 'Gagal menambahkan rumah sakit !');
71 71
     }
72 72
 
73 73
     /**
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     public function show($id)
80 80
     {
81 81
         $hospital = Hospital::find($id);
82
-        if(!$hospital) {
82
+        if (!$hospital) {
83 83
             abort(401);
84 84
         }
85 85
         $data = [
@@ -136,11 +136,11 @@  discard block
 block discarded – undo
136 136
         $hospital->public_services = $request->input('public_services');
137 137
         $hospital->cover_images_id = 1;
138 138
 
139
-        if($hospital->save()) {
140
-            return redirect (route('hospital.index'))->with('success', 'Rumah sakit berhasil di perbaharui');
139
+        if ($hospital->save()) {
140
+            return redirect(route('hospital.index'))->with('success', 'Rumah sakit berhasil di perbaharui');
141 141
         }
142 142
 
143
-        return redirect (route('hospital.edit', $id))->with('failed', 'Gagal memperbaharui rumah sakit !');
143
+        return redirect(route('hospital.edit', $id))->with('failed', 'Gagal memperbaharui rumah sakit !');
144 144
     }
145 145
 
146 146
     /**
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
         $hospital = Hospital::find($id);
155 155
         $rooms = $this->deleteRoomsAndRoomDetail($id);
156 156
 
157
-        if($hospital->delete() && $rooms) {
157
+        if ($hospital->delete() && $rooms) {
158 158
             return redirect(route('hospital.index'));
159 159
         }
160 160
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
             ->where('hospital_id', '=', $hospital_id)
175 175
             ->delete();
176 176
 
177
-        if($delroom && $deldetail) {
177
+        if ($delroom && $deldetail) {
178 178
             return true;
179 179
         }
180 180
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
         $rooms = DB::table('rooms')
191 191
             ->selectRaw(DB::raw('rooms.*'))
192 192
             ->leftJoin('room_details', 'rooms.id', '=', 'room_details.room_id')
193
-            ->where('room_details.hospital_id','=',$hospital_id)
193
+            ->where('room_details.hospital_id', '=', $hospital_id)
194 194
             ->get();
195 195
 
196 196
         return $rooms;
@@ -198,13 +198,13 @@  discard block
 block discarded – undo
198 198
 
199 199
     public function indexUser()
200 200
     {
201
-        $location = City::orderBy('name','asc')->pluck('name', 'id');
201
+        $location = City::orderBy('name', 'asc')->pluck('name', 'id');
202 202
         $img = 'storage/images/hospital-icon.jpg';
203 203
         $data = [
204 204
             'img' => $img,
205 205
             'location' => $location
206 206
         ];
207
-        return view ('SearchRS')->with('data',$data);
207
+        return view('SearchRS')->with('data', $data);
208 208
     }
209 209
 
210 210
     public function showList()
@@ -214,30 +214,30 @@  discard block
 block discarded – undo
214 214
 
215 215
     public function searchHospital(Request $request)
216 216
     {
217
-        if($request->nama == null AND $request->location != null){
218
-            $hospital = Hospital::where('city_id',$request->location)->orderBy('name','asc')->paginate(5);
219
-        }elseif ($request->location == null AND $request->nama != null){
220
-            $hospital = Hospital::where('biography','LIKE','%'.$request->nama.'%')->orderBy('name','asc')->paginate(5);
221
-        }else{
222
-            $hospital = Hospital::where('biography','LIKE','%'.$request->nama.'%')->where('city_id',$request->location)->orderBy('name','asc')->paginate(5);
217
+        if ($request->nama == null AND $request->location != null) {
218
+            $hospital = Hospital::where('city_id', $request->location)->orderBy('name', 'asc')->paginate(5);
219
+        }elseif ($request->location == null AND $request->nama != null) {
220
+            $hospital = Hospital::where('biography', 'LIKE', '%'.$request->nama.'%')->orderBy('name', 'asc')->paginate(5);
221
+        } else {
222
+            $hospital = Hospital::where('biography', 'LIKE', '%'.$request->nama.'%')->where('city_id', $request->location)->orderBy('name', 'asc')->paginate(5);
223 223
         }
224
-        $location = City::orderBy('name','asc')->pluck('name','id');
224
+        $location = City::orderBy('name', 'asc')->pluck('name', 'id');
225 225
         $data = [
226 226
             'hospital' => $hospital,
227 227
             'location' => $location
228 228
         ];
229
-        return view ('listHospital')->with('data',$data);
229
+        return view('listHospital')->with('data', $data);
230 230
     }
231 231
 
232 232
     public function searchContent($content)
233 233
     {
234
-        $hospital = Hospital::where('biography','LIKE','%'.$content.'%')->orderBy('name','asc')->paginate(5);
235
-        $location = City::orderBy('name','asc')->pluck('name','id');
234
+        $hospital = Hospital::where('biography', 'LIKE', '%'.$content.'%')->orderBy('name', 'asc')->paginate(5);
235
+        $location = City::orderBy('name', 'asc')->pluck('name', 'id');
236 236
         $data = [
237 237
             'hospital' => $hospital,
238 238
             'location' => $location
239 239
         ];
240
-        return view ('listHospital')->with('data',$data);
240
+        return view('listHospital')->with('data', $data);
241 241
     }
242 242
 
243 243
     public function viewHospital($id)
@@ -247,6 +247,6 @@  discard block
 block discarded – undo
247 247
             'hospital' => $hospital,
248 248
             'room' => $this->getRooms($id),
249 249
         ];
250
-        return view ('viewhospital')->with('data',$data);
250
+        return view('viewhospital')->with('data', $data);
251 251
     }
252 252
 }
Please login to merge, or discard this patch.