Passed
Push — master ( 529285...7a2fda )
by
unknown
04:42
created
app/City.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@
 block discarded – undo
4 4
 
5 5
 use Illuminate\Database\Eloquent\Model;
6 6
 
7
-class City extends Model
8
-{
7
+class City extends Model {
9 8
     /**
10 9
      * @var string
11 10
      */
Please login to merge, or discard this patch.
app/Hospital.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function city()
36 36
     {
37
-        return $this->belongsTo('App\City','city_id');
37
+        return $this->belongsTo('App\City', 'city_id');
38 38
     }
39 39
 
40 40
     /**
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public function trimStr($str)
45 45
     {
46
-        if(strlen($str) > 10) {
46
+        if (strlen($str) > 10) {
47 47
             return substr($str, 0, 10)."...";
48 48
         }
49 49
         return $str;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@
 block discarded – undo
4 4
 
5 5
 use Illuminate\Database\Eloquent\Model;
6 6
 
7
-class Hospital extends Model
8
-{
7
+class Hospital extends Model {
9 8
     /**
10 9
      * @var string
11 10
      */
Please login to merge, or discard this patch.
app/DoctorDetail.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@
 block discarded – undo
4 4
 
5 5
 use Illuminate\Database\Eloquent\Model;
6 6
 
7
-class DoctorDetail extends Model
8
-{
7
+class DoctorDetail extends Model {
9 8
     /**
10 9
      * @var string
11 10
      */
Please login to merge, or discard this patch.
app/Http/Controllers/DocController.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,7 @@
 block discarded – undo
10 10
 use Illuminate\Support\Facades\Hash;
11 11
 use Illuminate\Support\Facades\Storage;
12 12
 
13
-class DocController extends Controller
14
-{
13
+class DocController extends Controller {
15 14
     /**
16 15
      * Create a new controller instance
17 16
      *
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
41 41
             'warning' => null
42 42
         ];
43 43
 
44
-        if( $doctor->city_id == null ||
44
+        if ($doctor->city_id == null ||
45 45
             $doctor->gender == null ||
46 46
             $doctor->biography == null ||
47 47
             $doctor->profile_picture == 'user-default.jpg') {
48 48
 
49
-            $data['warning'] = 'Sepertinya anda belum melengkapi data diri anda, segera lengkapi data diri anda.';
49
+            $data[ 'warning' ] = 'Sepertinya anda belum melengkapi data diri anda, segera lengkapi data diri anda.';
50 50
         }
51 51
         return view('pages.dashboard')->with('data', $data);
52 52
     }
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     public function profile($id)
61 61
     {
62 62
         $doctor = $this->currentUser();
63
-        if($doctor->id == $id) {
63
+        if ($doctor->id == $id) {
64 64
             $data = [
65 65
                 'doctor' => $doctor
66 66
             ];
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     public function edit($id)
80 80
     {
81 81
         $doctor = $this->currentUser();
82
-        if($doctor->id == $id) {
82
+        if ($doctor->id == $id) {
83 83
             $specialization = DoctorSpecialization::pluck('name', 'id');
84 84
             $cities = City::pluck('name', 'id');
85 85
 
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
         $doctor = $this->currentUser();
116 116
         $img = null;
117 117
 
118
-        if($request->hasFile('profile_picture')) {
118
+        if ($request->hasFile('profile_picture')) {
119 119
 
120
-            if( $doctor->profile_picture != "user-default.jpg") {
120
+            if ($doctor->profile_picture != "user-default.jpg") {
121 121
                 Storage::delete('public/user_images/'.$doctor->profile_picture);
122 122
             }
123 123
 
@@ -139,11 +139,11 @@  discard block
 block discarded – undo
139 139
         $doctor->gender = $request->input('gender');
140 140
         $doctor->specialization_id = $request->input('specialization_id');
141 141
         $doctor->biography = $request->input('biography');
142
-        if($request->hasFile('profile_picture')) {
142
+        if ($request->hasFile('profile_picture')) {
143 143
             $doctor->profile_picture = $img;
144 144
         }
145 145
 
146
-        if($doctor->save()) {
146
+        if ($doctor->save()) {
147 147
             return redirect(route('doctor.profile', $doctor->id))->with('success', 'Profil berhasil diperbarui !');
148 148
         }
149 149
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     public function editPass($id)
160 160
     {
161 161
         $doctor = $this->currentUser();
162
-        if($doctor->id == $id) {
162
+        if ($doctor->id == $id) {
163 163
             $data = [
164 164
                 'doctor' => $doctor
165 165
             ];
@@ -178,8 +178,8 @@  discard block
 block discarded – undo
178 178
     public function updatePass(Request $request, $id)
179 179
     {
180 180
         $doctor = $this->currentUser();
181
-        if($this->validatePass($request->input('old_password'))) {
182
-            if($request->input('old_password') == $request->input('new_password')) {
181
+        if ($this->validatePass($request->input('old_password'))) {
182
+            if ($request->input('old_password') == $request->input('new_password')) {
183 183
                 return redirect(route('doctor.password.edit', $doctor->id))->with('warning', 'Password baru tidak boleh sama dengan Password lama.');
184 184
             }
185 185
 
@@ -203,12 +203,12 @@  discard block
 block discarded – undo
203 203
     public function removeImage()
204 204
     {
205 205
         $doctor = $this->currentUser();
206
-        if($doctor->profile_picture != "user-default.jpg") {
206
+        if ($doctor->profile_picture != "user-default.jpg") {
207 207
             Storage::delete('public/user_images/'.$doctor->profile_picture);
208 208
         }
209 209
 
210 210
         $doctor->profile_picture = "user-default.jpg";
211
-        if($doctor->save()) {
211
+        if ($doctor->save()) {
212 212
             return redirect(route('doctor.profile.edit', $doctor->id))->with('success', 'Foto profil berhasil dihapus !');
213 213
         }
214 214
         return redirect(route('doctor.profile.edit', $doctor->id))->with('failed', 'Gagal menghapus foto profil.');
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
     public function destroy()
219 219
     {
220 220
         $doctor = $this->currentUser();
221
-        if($doctor->delete()) {
221
+        if ($doctor->delete()) {
222 222
             session()->flush();
223 223
             return redirect(route('doctor.login'))->with('success', 'Akun telah dihapus !');
224 224
         }
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
     private function validatePass(string $oldPassword)
243 243
     {
244 244
         $doctor = $this->currentUser();
245
-        if(Hash::check($oldPassword, $doctor->password)) {
245
+        if (Hash::check($oldPassword, $doctor->password)) {
246 246
             return true;
247 247
         }
248 248
 
Please login to merge, or discard this patch.