Passed
Pull Request — master (#50)
by
unknown
04:43
created
app/Http/Controllers/SpecializationController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
         $specialty->name = $request->input('name');
52 52
         $specialty->detail = $request->input('detail');
53 53
 
54
-        if($specialty->save()) {
55
-            return redirect (route('specialty.index'))->with('success', 'Spesialisasi telah di tambahkan');
54
+        if ($specialty->save()) {
55
+            return redirect(route('specialty.index'))->with('success', 'Spesialisasi telah di tambahkan');
56 56
         }
57 57
 
58
-        return redirect (route('specialty.index'))->with('failed', 'Gagal menambah spesialisasi !');
58
+        return redirect(route('specialty.index'))->with('failed', 'Gagal menambah spesialisasi !');
59 59
 
60 60
     }
61 61
 
@@ -103,11 +103,11 @@  discard block
 block discarded – undo
103 103
         $specialty->name = $request->input('name');
104 104
         $specialty->detail = $request->input('detail');
105 105
 
106
-        if($specialty->save()) {
107
-            return redirect (route('specialty.index'))->with('success', 'Spesialisasi telah di update');
106
+        if ($specialty->save()) {
107
+            return redirect(route('specialty.index'))->with('success', 'Spesialisasi telah di update');
108 108
         }
109 109
 
110
-        return redirect (route('specialty.edit', $id))->with('failed', 'Gagal memperbaharui spesialisasi !');
110
+        return redirect(route('specialty.edit', $id))->with('failed', 'Gagal memperbaharui spesialisasi !');
111 111
     }
112 112
 
113 113
     /**
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     public function destroy($id)
120 120
     {
121 121
         $specialty = DoctorSpecialization::find($id);
122
-        if($specialty->delete()) {
122
+        if ($specialty->delete()) {
123 123
             return redirect(route('specialty.index'));
124 124
         }
125 125
     }
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 
137 137
     public function indexSearch()
138 138
     {
139
-        $specialization = DoctorSpecialization::orderBy('created_at','desc')->orderBy('name', 'asc')->take(6)->get();
139
+        $specialization = DoctorSpecialization::orderBy('created_at', 'desc')->orderBy('name', 'asc')->take(6)->get();
140 140
         $data = [
141 141
             'specialization' => $specialization
142 142
         ];
Please login to merge, or discard this patch.
app/Http/Controllers/DoctorController.php 1 patch
Spacing   +14 added lines, -14 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
-        $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
 block discarded – undo
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
 block discarded – undo
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
     /**
@@ -77,18 +77,18 @@  discard block
 block discarded – undo
77 77
      */
78 78
     public function show($id)
79 79
     {
80
-        $doctor = Doctor::where('specialization_id',$id)->orderBy('name','asc')->paginate(5);
80
+        $doctor = Doctor::where('specialization_id', $id)->orderBy('name', 'asc')->paginate(5);
81 81
         $data = [
82 82
             'doctor' => $doctor
83 83
         ];
84
-        return view('listDoctor')->with('data',$data);
84
+        return view('listDoctor')->with('data', $data);
85 85
     }
86 86
 
87 87
     public function showDoctor($id)
88 88
     {
89 89
         $doctor = Doctor::find($id);
90 90
 
91
-        return view('viewDoctor')->with('doctor',$doctor);
91
+        return view('viewDoctor')->with('doctor', $doctor);
92 92
     }
93 93
     /**
94 94
      * Show the form for editing the specified resource.
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public function update(Request $request, $id)
118 118
     {
119
-        $this->validate($request,[
119
+        $this->validate($request, [
120 120
             'name' => 'required|min:3|max:50',
121 121
             'password' => 'required_with:password_confirmation|same:password_confirmation|min:6',
122 122
             'password_confirmation' => 'min:6'
@@ -126,11 +126,11 @@  discard block
 block discarded – undo
126 126
         $doctor = Doctor::find($id);
127 127
         $doctor->name = $request->input('name');
128 128
         $doctor->password = $pass;
129
-        if($doctor->save()) {
130
-            return redirect (route('doctor.index'))->with('success', 'Doktor berhasil di update !');
129
+        if ($doctor->save()) {
130
+            return redirect(route('doctor.index'))->with('success', 'Doktor berhasil di update !');
131 131
         }
132 132
 
133
-        return redirect (route('doctor.edit', $id))->with('failed', 'Gagal memperbaharui dokter !');
133
+        return redirect(route('doctor.edit', $id))->with('failed', 'Gagal memperbaharui dokter !');
134 134
     }
135 135
 
136 136
     // public function showSpecialty()
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         $doctor = Doctor::find($id);
150 150
         $doctor->delete();
151 151
 
152
-        return redirect (route('doctor.index'));
152
+        return redirect(route('doctor.index'));
153 153
     }
154 154
 
155 155
 }
Please login to merge, or discard this patch.