Passed
Push — master ( d58bf8...6af014 )
by Faiq
04:49
created
app/User.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
      */
52 52
     public function trimStr(string $str)
53 53
     {
54
-        if(strlen($str) > 50) {
54
+        if (strlen($str) > 50) {
55 55
             return substr($str, '0', '50')."...";
56 56
         }
57 57
         return $str;
Please login to merge, or discard this patch.
app/Doctor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
      */
79 79
     public function trimStr($str)
80 80
     {
81
-        if(strlen($str) > 20) {
81
+        if (strlen($str) > 20) {
82 82
             return substr($str, 0, 20)."...";
83 83
         }
84 84
         return $str;
Please login to merge, or discard this patch.
app/Http/Middleware/Authenticate.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,10 +14,10 @@
 block discarded – undo
14 14
      */
15 15
     protected function redirectTo($request)
16 16
     {
17
-        if (! $request->expectsJson()) {
18
-            if($request->is('admin') || $request->is('admin/*')) {
17
+        if (!$request->expectsJson()) {
18
+            if ($request->is('admin') || $request->is('admin/*')) {
19 19
                 return route('admin.login');
20
-            } else if($request->is('doctor') || $request->is('doctor/*')) {
20
+            } else if ($request->is('doctor') || $request->is('doctor/*')) {
21 21
                 return route('doctor.login');
22 22
             } else {
23 23
                 return route('login');
Please login to merge, or discard this patch.
app/Http/Middleware/RedirectIfAuthenticated.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,14 +17,14 @@
 block discarded – undo
17 17
      */
18 18
     public function handle($request, Closure $next, $guard = null)
19 19
     {
20
-        switch($guard) {
20
+        switch ($guard) {
21 21
             case 'admin':
22
-                if(Auth::guard($guard)->check()) {
22
+                if (Auth::guard($guard)->check()) {
23 23
                     return redirect()->route('admin.index');
24 24
                 }
25 25
                 break;
26 26
             case 'doctor':
27
-                if(Auth::guard($guard)->check()) {
27
+                if (Auth::guard($guard)->check()) {
28 28
                     return redirect()->route('admin.index');
29 29
                 }
30 30
                 break;
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/DoctorLoginController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             'password' => 'required|min:6'
35 35
         ]);
36 36
 
37
-        if($validate->fails()) {
37
+        if ($validate->fails()) {
38 38
             return redirect()->back()->withErrors($validate);
39 39
         }
40 40
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         ];
45 45
 
46 46
         // Attempt Login
47
-        if(Auth::guard('doctor')->attempt($credentials, $request->remember)) {
47
+        if (Auth::guard('doctor')->attempt($credentials, $request->remember)) {
48 48
             // If 'true' -> redirect to admin.index
49 49
             session([
50 50
                 'role' => 'Doctor',
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     private function sendFailedLoginResponse(Request $request)
60 60
     {
61 61
         throw ValidationException::withMessages([
62
-           'email' => [trans('auth.failed')],
62
+           'email' => [ trans('auth.failed') ],
63 63
         ]);
64 64
     }
65 65
 }
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/RegisterController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
     protected function validator(array $data)
50 50
     {
51 51
         return Validator::make($data, [
52
-            'name' => ['required', 'string', 'max:255'],
53
-            'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
54
-            'password' => ['required', 'string', 'min:8', 'confirmed'],
52
+            'name' => [ 'required', 'string', 'max:255' ],
53
+            'email' => [ 'required', 'string', 'email', 'max:255', 'unique:users' ],
54
+            'password' => [ 'required', 'string', 'min:8', 'confirmed' ],
55 55
         ]);
56 56
     }
57 57
 
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
     protected function create(array $data)
65 65
     {
66 66
         return User::create([
67
-            'name' => $data['name'],
68
-            'email' => $data['email'],
69
-            'password' => Hash::make($data['password']),
67
+            'name' => $data[ 'name' ],
68
+            'email' => $data[ 'email' ],
69
+            'password' => Hash::make($data[ 'password' ]),
70 70
         ]);
71 71
     }
72 72
 }
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/AdminLoginController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             'password' => 'required|min:6'
35 35
         ]);
36 36
 
37
-        if($validate->fails()) {
37
+        if ($validate->fails()) {
38 38
             return redirect()->back()->withErrors($validate);
39 39
         }
40 40
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         ];
45 45
 
46 46
         // Attempt Login
47
-        if(Auth::guard('admin')->attempt($credentials, $request->remember)) {
47
+        if (Auth::guard('admin')->attempt($credentials, $request->remember)) {
48 48
             // If 'true' -> redirect to admin.index
49 49
             session([
50 50
                 'role' => 'Admin',
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     private function sendFailedLoginResponse(Request $request)
61 61
     {
62 62
         throw ValidationException::withMessages([
63
-            'email' => [trans('auth.failed')],
63
+            'email' => [ trans('auth.failed') ],
64 64
         ]);
65 65
     }
66 66
 
Please login to merge, or discard this patch.
app/Http/Controllers/MemberController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,12 +15,12 @@
 block discarded – undo
15 15
 
16 16
     public function index()
17 17
     {
18
-        $user = User::orderBy('name','asc')->paginate(10);
18
+        $user = User::orderBy('name', 'asc')->paginate(10);
19 19
         $data = [
20 20
             'role' => session('role'),
21 21
             'user' => $user,
22 22
         ];
23
-        return view('pages.member')->with('data',$data);
23
+        return view('pages.member')->with('data', $data);
24 24
     }
25 25
 
26 26
     /**
Please login to merge, or discard this patch.
app/Articles.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -38,14 +38,14 @@  discard block
 block discarded – undo
38 38
         $adminId = $this->getAttributeValue('admin_id');
39 39
         $doctorId = $this->getAttributeValue('doctor_id');
40 40
 
41
-        $writer = ['role', 'data'];
41
+        $writer = [ 'role', 'data' ];
42 42
 
43
-        if($adminId != null) {
44
-            $writer['role'] = "Admin";
45
-            $writer['data'] = Admin::find($adminId);
46
-        } elseif($doctorId != null) {
47
-            $writer['role'] = "Dokter";
48
-            $writer['data'] = Doctor::find($doctorId);
43
+        if ($adminId != null) {
44
+            $writer[ 'role' ] = "Admin";
45
+            $writer[ 'data' ] = Admin::find($adminId);
46
+        } elseif ($doctorId != null) {
47
+            $writer[ 'role' ] = "Dokter";
48
+            $writer[ 'data' ] = Doctor::find($doctorId);
49 49
         }
50 50
 
51 51
         return $writer;
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
      */
58 58
     public function cutStr($str)
59 59
     {
60
-        if (strlen($str) > 200){
61
-            return substr($str,0,200) . "...";
60
+        if (strlen($str) > 200) {
61
+            return substr($str, 0, 200)."...";
62 62
         }
63 63
         return $str;
64 64
     }
@@ -70,11 +70,11 @@  discard block
 block discarded – undo
70 70
     public function getCat($str)
71 71
     {
72 72
         switch ($str) {
73
-            case "penyakit":    return "Penyakit";      break;
73
+            case "penyakit":    return "Penyakit"; break;
74 74
             case "obat":        return "Obat - obatan"; break;
75
-            case "hidup-sehat": return "Hidup Sehat";   break;
76
-            case "keluarga":    return "Keluarga";      break;
77
-            case "kesehatan":   return "Kesehatan";     break;
75
+            case "hidup-sehat": return "Hidup Sehat"; break;
76
+            case "keluarga":    return "Keluarga"; break;
77
+            case "kesehatan":   return "Kesehatan"; break;
78 78
         }
79 79
     }
80 80
 }
Please login to merge, or discard this patch.