Passed
Push — develop ( 6dcea6...5ae9a6 )
by Septianata
16:24
created
routes/web.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -26,58 +26,58 @@  discard block
 block discarded – undo
26 26
 
27 27
 Route::view('/', 'welcome');
28 28
 
29
-Route::get('/order/{order}', [OrderController::class, 'show'])->name('admin.order.show');
29
+Route::get('/order/{order}', [ OrderController::class, 'show' ])->name('admin.order.show');
30 30
 
31
-Route::middleware('auth:web', 'verified', 'user_is_active')->name('admin.')->group(function () {
31
+Route::middleware('auth:web', 'verified', 'user_is_active')->name('admin.')->group(function() {
32 32
     Route::get('/dashboard', DashboardController::class)->name('dashboard');
33 33
 
34
-    Route::prefix('/order')->name('order.')->group(function () {
35
-        Route::post('/datatable', [OrderController::class, 'datatable'])->name('datatable');
36
-        Route::post('/{order}/datatable-row-child', [OrderController::class, 'datatableRowChild'])->name('datatable-row-child');
37
-        Route::delete('/multiple', [OrderController::class, 'destroyMultiple'])->name('destroy-multiple');
34
+    Route::prefix('/order')->name('order.')->group(function() {
35
+        Route::post('/datatable', [ OrderController::class, 'datatable' ])->name('datatable');
36
+        Route::post('/{order}/datatable-row-child', [ OrderController::class, 'datatableRowChild' ])->name('datatable-row-child');
37
+        Route::delete('/multiple', [ OrderController::class, 'destroyMultiple' ])->name('destroy-multiple');
38 38
 
39
-        Route::get('/{order}/status/{enumOrderStatus}/create', [OrderStatusController::class, 'create'])->name('status.create');
40
-        Route::post('/{order}/status/{enumOrderStatus}', [OrderStatusController::class, 'store'])->name('status.store');
41
-        Route::delete('/{order}/status/{status:status}', [OrderStatusController::class, 'destroy'])->name('status.destroy');
39
+        Route::get('/{order}/status/{enumOrderStatus}/create', [ OrderStatusController::class, 'create' ])->name('status.create');
40
+        Route::post('/{order}/status/{enumOrderStatus}', [ OrderStatusController::class, 'store' ])->name('status.store');
41
+        Route::delete('/{order}/status/{status:status}', [ OrderStatusController::class, 'destroy' ])->name('status.destroy');
42 42
 
43
-        Route::get('/{order}/item/create', [ItemController::class, 'create'])->name('item.create');
44
-        Route::post('/{order}/item', [ItemController::class, 'store'])->name('item.store');
45
-        Route::get('/{order}/item/{item:}/edit', [ItemController::class, 'edit'])->name('item.edit');
46
-        Route::put('/{order}/item/{item:}', [ItemController::class, 'update'])->name('item.update');
47
-        Route::delete('/{order}/item/{item:}', [ItemController::class, 'destroy'])->name('item.destroy');
43
+        Route::get('/{order}/item/create', [ ItemController::class, 'create' ])->name('item.create');
44
+        Route::post('/{order}/item', [ ItemController::class, 'store' ])->name('item.store');
45
+        Route::get('/{order}/item/{item:}/edit', [ ItemController::class, 'edit' ])->name('item.edit');
46
+        Route::put('/{order}/item/{item:}', [ ItemController::class, 'update' ])->name('item.update');
47
+        Route::delete('/{order}/item/{item:}', [ ItemController::class, 'destroy' ])->name('item.destroy');
48 48
     });
49 49
 
50
-    Route::prefix('/user')->name('user.')->group(function () {
51
-        Route::post('/datatable', [UserController::class, 'datatable'])->name('datatable');
52
-        Route::delete('/multiple', [UserController::class, 'destroyMultiple'])->name('destroy-multiple');
53
-        Route::get('/{user}/verify-email-address', [UserController::class, 'verifyEmailAddress'])->name('verify-email-address');
50
+    Route::prefix('/user')->name('user.')->group(function() {
51
+        Route::post('/datatable', [ UserController::class, 'datatable' ])->name('datatable');
52
+        Route::delete('/multiple', [ UserController::class, 'destroyMultiple' ])->name('destroy-multiple');
53
+        Route::get('/{user}/verify-email-address', [ UserController::class, 'verifyEmailAddress' ])->name('verify-email-address');
54 54
     });
55 55
 
56
-    Route::prefix('/branch')->name('branch.')->group(function () {
57
-        Route::post('/datatable', [BranchController::class, 'datatable'])->name('datatable');
58
-        Route::delete('/multiple', [BranchController::class, 'destroyMultiple'])->name('destroy-multiple');
56
+    Route::prefix('/branch')->name('branch.')->group(function() {
57
+        Route::post('/datatable', [ BranchController::class, 'datatable' ])->name('datatable');
58
+        Route::delete('/multiple', [ BranchController::class, 'destroyMultiple' ])->name('destroy-multiple');
59 59
     });
60 60
 
61
-    Route::prefix('/customer')->name('customer.')->group(function () {
62
-        Route::post('/datatable', [CustomerController::class, 'datatable'])->name('datatable');
63
-        Route::delete('/multiple', [CustomerController::class, 'destroyMultiple'])->name('destroy-multiple');
64
-        Route::delete('/{customer}/identitycard_image', [CustomerController::class, 'destroyIdentitycardImage'])->name('destroy-identitycard_image');
61
+    Route::prefix('/customer')->name('customer.')->group(function() {
62
+        Route::post('/datatable', [ CustomerController::class, 'datatable' ])->name('datatable');
63
+        Route::delete('/multiple', [ CustomerController::class, 'destroyMultiple' ])->name('destroy-multiple');
64
+        Route::delete('/{customer}/identitycard_image', [ CustomerController::class, 'destroyIdentitycardImage' ])->name('destroy-identitycard_image');
65 65
     });
66 66
 
67
-    Route::prefix('/denomination')->name('denomination.')->group(function () {
68
-        Route::post('/datatable', [DenominationController::class, 'datatable'])->name('datatable');
69
-        Route::delete('/multiple', [DenominationController::class, 'destroyMultiple'])->name('destroy-multiple');
70
-        Route::delete('/{denomination}/image', [DenominationController::class, 'destroyImage'])->name('destroy-image');
67
+    Route::prefix('/denomination')->name('denomination.')->group(function() {
68
+        Route::post('/datatable', [ DenominationController::class, 'datatable' ])->name('datatable');
69
+        Route::delete('/multiple', [ DenominationController::class, 'destroyMultiple' ])->name('destroy-multiple');
70
+        Route::delete('/{denomination}/image', [ DenominationController::class, 'destroyImage' ])->name('destroy-image');
71 71
     });
72 72
 
73
-    Route::prefix('/role')->name('role.')->group(function () {
74
-        Route::post('/datatable', [RoleController::class, 'datatable'])->name('datatable');
75
-        Route::delete('/multiple', [RoleController::class, 'destroyMultiple'])->name('destroy-multiple');
73
+    Route::prefix('/role')->name('role.')->group(function() {
74
+        Route::post('/datatable', [ RoleController::class, 'datatable' ])->name('datatable');
75
+        Route::delete('/multiple', [ RoleController::class, 'destroyMultiple' ])->name('destroy-multiple');
76 76
     });
77 77
 
78
-    Route::prefix('/configuration')->name('configuration.')->group(function () {
79
-        Route::post('/datatable', [ConfigurationController::class, 'datatable'])->name('datatable');
80
-        Route::delete('/multiple', [ConfigurationController::class, 'destroyMultiple'])->name('destroy-multiple');
78
+    Route::prefix('/configuration')->name('configuration.')->group(function() {
79
+        Route::post('/datatable', [ ConfigurationController::class, 'datatable' ])->name('datatable');
80
+        Route::delete('/multiple', [ ConfigurationController::class, 'destroyMultiple' ])->name('destroy-multiple');
81 81
     });
82 82
 
83 83
     Route::resource('/order', OrderController::class)->except('create', 'show', 'edit', 'update');
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
     Route::resource('/role', RoleController::class)->except('show');
89 89
     Route::resource('/configuration', ConfigurationController::class)->except('show');
90 90
 
91
-    Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
92
-    Route::put('/profile', [ProfileController::class, 'update'])->name('profile.update');
91
+    Route::get('/profile', [ ProfileController::class, 'edit' ])->name('profile.edit');
92
+    Route::put('/profile', [ ProfileController::class, 'update' ])->name('profile.update');
93 93
 });
94 94
 
95 95
 require __DIR__.'/auth.php';
Please login to merge, or discard this patch.
app/Conversations/CheckOrderStatusConversation.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     {
36 36
         $this->displayValidationErrorMessage($validationErrorMessage);
37 37
 
38
-        return $this->askRenderable('conversations.check-order-status.ask-code', function (Answer $answer) {
38
+        return $this->askRenderable('conversations.check-order-status.ask-code', function(Answer $answer) {
39 39
             if (trim($answer->getText()) === $this->cancelText()) {
40 40
                 return $this->cancelCheck();
41 41
             }
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
 
47 47
             $order->load('customer:id,fullname', 'user:id,fullname', 'branch', 'items.denomination');
48 48
 
49
-            return $this->sayRenderable('conversations.check-order-status.alert-order', compact('order'), [], ['reply_markup' => json_encode([
49
+            return $this->sayRenderable('conversations.check-order-status.alert-order', compact('order'), [ ], [ 'reply_markup' => json_encode([
50 50
                 'remove_keyboard' => true,
51
-            ])]);
51
+            ]) ]);
52 52
         }, additionalParameters: Keyboard::create(Keyboard::TYPE_KEYBOARD)->addRow(
53 53
             KeyboardButton::create($this->cancelText())
54 54
         )->toArray());
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
      */
72 72
     protected function cancelCheck()
73 73
     {
74
-        return $this->sayRenderable('conversations.check-order-status.alert-cancel', additionalParameters: ['reply_markup' => json_encode([
74
+        return $this->sayRenderable('conversations.check-order-status.alert-cancel', additionalParameters: [ 'reply_markup' => json_encode([
75 75
             'remove_keyboard' => true,
76
-        ])]);
76
+        ]) ]);
77 77
     }
78 78
 }
Please login to merge, or discard this patch.
app/Providers/AuthServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@
 block discarded – undo
29 29
     {
30 30
         $this->registerPolicies();
31 31
 
32
-        Gate::define('view-dashboard', function (User $user) {
33
-            return $user->hasRole([Role::ROLE_ADMIN, Role::ROLE_STAFF]);
32
+        Gate::define('view-dashboard', function(User $user) {
33
+            return $user->hasRole([ Role::ROLE_ADMIN, Role::ROLE_STAFF ]);
34 34
         });
35 35
     }
36 36
 }
Please login to merge, or discard this patch.
app/Providers/RouteServiceProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     {
44 44
         $this->configureRateLimiting();
45 45
 
46
-        $this->routes(function () {
46
+        $this->routes(function() {
47 47
             Route::prefix('api')
48 48
                 ->middleware('api')
49 49
                 ->namespace($this->namespace)
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
                 ->namespace($this->namespace)
54 54
                 ->group(base_path('routes/web.php'));
55 55
 
56
-            Route::match(['get', 'post'], '/botman', function () {
56
+            Route::match([ 'get', 'post' ], '/botman', function() {
57 57
                 $this->mapBotManCommands();
58 58
             })->middleware('web_without_csrf');
59 59
         });
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      */
69 69
     protected function configureRateLimiting()
70 70
     {
71
-        RateLimiter::for('api', function (Request $request) {
71
+        RateLimiter::for ('api', function(Request $request) {
72 72
             return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
73 73
         });
74 74
     }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     protected function resolveEnumBinding()
94 94
     {
95 95
         foreach ($this->enums as $name => $class) {
96
-            Route::bind($name, function ($value) use ($class) {
96
+            Route::bind($name, function($value) use ($class) {
97 97
                 return $class::from($value);
98 98
             });
99 99
         }
Please login to merge, or discard this patch.
app/Policies/OrderPolicy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
      */
21 21
     public function before(?User $user, $ability)
22 22
     {
23
-        if ($user && $user->hasRole([Role::ROLE_ADMIN, ROLE::ROLE_STAFF])) {
23
+        if ($user && $user->hasRole([ Role::ROLE_ADMIN, ROLE::ROLE_STAFF ])) {
24 24
             return true;
25 25
         }
26 26
     }
Please login to merge, or discard this patch.
app/Policies/CustomerPolicy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
      */
21 21
     public function before(User $user, $ability)
22 22
     {
23
-        if ($user->hasRole([Role::ROLE_ADMIN, Role::ROLE_STAFF])) {
23
+        if ($user->hasRole([ Role::ROLE_ADMIN, Role::ROLE_STAFF ])) {
24 24
             return true;
25 25
         }
26 26
     }
Please login to merge, or discard this patch.
app/Models/Concerns/User/Attribute.php 5 patches
Indentation   -31 removed lines patch added patch discarded remove patch
@@ -45,34 +45,3 @@
 block discarded – undo
45 45
     {
46 46
         if ($this->is_active) {
47 47
             return sprintf(<<<'html'
48
-            <div class="badge badge-success">%s</div>
49
-            html, trans('Active'));
50
-        }
51
-
52
-        return sprintf(<<<'html'
53
-        <div class="badge badge-danger">%s</div>
54
-        html, trans('Not Active'));
55
-    }
56
-
57
-    /**
58
-     * Return "role" attribute value.
59
-     *
60
-     * @return string
61
-     */
62
-    public function getRoleAttribute(): string
63
-    {
64
-        $this->load('roles:id,name');
65
-
66
-        return $this->roles->first()->name;
67
-    }
68
-
69
-    /**
70
-     * Return "gravatar_image" attribute value.
71
-     *
72
-     * @return string
73
-     */
74
-    public function getGravatarImageAttribute(): string
75
-    {
76
-        return gravatar_image($this->email);
77
-    }
78
-}
Please login to merge, or discard this patch.
Switch Indentation   -31 removed lines patch added patch discarded remove patch
@@ -45,34 +45,3 @@
 block discarded – undo
45 45
     {
46 46
         if ($this->is_active) {
47 47
             return sprintf(<<<'html'
48
-            <div class="badge badge-success">%s</div>
49
-            html, trans('Active'));
50
-        }
51
-
52
-        return sprintf(<<<'html'
53
-        <div class="badge badge-danger">%s</div>
54
-        html, trans('Not Active'));
55
-    }
56
-
57
-    /**
58
-     * Return "role" attribute value.
59
-     *
60
-     * @return string
61
-     */
62
-    public function getRoleAttribute(): string
63
-    {
64
-        $this->load('roles:id,name');
65
-
66
-        return $this->roles->first()->name;
67
-    }
68
-
69
-    /**
70
-     * Return "gravatar_image" attribute value.
71
-     *
72
-     * @return string
73
-     */
74
-    public function getGravatarImageAttribute(): string
75
-    {
76
-        return gravatar_image($this->email);
77
-    }
78
-}
Please login to merge, or discard this patch.
Spacing   +1 added lines, -32 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      */
32 32
     public function setPasswordAttribute($value)
33 33
     {
34
-        $this->attributes['password'] = Hash::make($value);
34
+        $this->attributes[ 'password' ] = Hash::make($value);
35 35
 
36 36
         return $this;
37 37
     }
@@ -45,34 +45,3 @@  discard block
 block discarded – undo
45 45
     {
46 46
         if ($this->is_active) {
47 47
             return sprintf(<<<'html'
48
-            <div class="badge badge-success">%s</div>
49
-            html, trans('Active'));
50
-        }
51
-
52
-        return sprintf(<<<'html'
53
-        <div class="badge badge-danger">%s</div>
54
-        html, trans('Not Active'));
55
-    }
56
-
57
-    /**
58
-     * Return "role" attribute value.
59
-     *
60
-     * @return string
61
-     */
62
-    public function getRoleAttribute(): string
63
-    {
64
-        $this->load('roles:id,name');
65
-
66
-        return $this->roles->first()->name;
67
-    }
68
-
69
-    /**
70
-     * Return "gravatar_image" attribute value.
71
-     *
72
-     * @return string
73
-     */
74
-    public function getGravatarImageAttribute(): string
75
-    {
76
-        return gravatar_image($this->email);
77
-    }
78
-}
Please login to merge, or discard this patch.
Braces   -31 removed lines patch added patch discarded remove patch
@@ -45,34 +45,3 @@
 block discarded – undo
45 45
     {
46 46
         if ($this->is_active) {
47 47
             return sprintf(<<<'html'
48
-            <div class="badge badge-success">%s</div>
49
-            html, trans('Active'));
50
-        }
51
-
52
-        return sprintf(<<<'html'
53
-        <div class="badge badge-danger">%s</div>
54
-        html, trans('Not Active'));
55
-    }
56
-
57
-    /**
58
-     * Return "role" attribute value.
59
-     *
60
-     * @return string
61
-     */
62
-    public function getRoleAttribute(): string
63
-    {
64
-        $this->load('roles:id,name');
65
-
66
-        return $this->roles->first()->name;
67
-    }
68
-
69
-    /**
70
-     * Return "gravatar_image" attribute value.
71
-     *
72
-     * @return string
73
-     */
74
-    public function getGravatarImageAttribute(): string
75
-    {
76
-        return gravatar_image($this->email);
77
-    }
78
-}
Please login to merge, or discard this patch.
Upper-Lower-Casing   -31 removed lines patch added patch discarded remove patch
@@ -45,34 +45,3 @@
 block discarded – undo
45 45
     {
46 46
         if ($this->is_active) {
47 47
             return sprintf(<<<'html'
48
-            <div class="badge badge-success">%s</div>
49
-            html, trans('Active'));
50
-        }
51
-
52
-        return sprintf(<<<'html'
53
-        <div class="badge badge-danger">%s</div>
54
-        html, trans('Not Active'));
55
-    }
56
-
57
-    /**
58
-     * Return "role" attribute value.
59
-     *
60
-     * @return string
61
-     */
62
-    public function getRoleAttribute(): string
63
-    {
64
-        $this->load('roles:id,name');
65
-
66
-        return $this->roles->first()->name;
67
-    }
68
-
69
-    /**
70
-     * Return "gravatar_image" attribute value.
71
-     *
72
-     * @return string
73
-     */
74
-    public function getGravatarImageAttribute(): string
75
-    {
76
-        return gravatar_image($this->email);
77
-    }
78
-}
Please login to merge, or discard this patch.
app/Models/Concerns/Customer/Attribute.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
             return null;
42 42
         }
43 43
 
44
-        return Storage::url(static::IDENTITYCARD_IMAGE_PATH . '/' . $value);
44
+        return Storage::url(static::IDENTITYCARD_IMAGE_PATH.'/'.$value);
45 45
     }
46 46
 
47 47
     /**
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public function getWhatsappPhoneUrlAttribute(): string
67 67
     {
68
-        return 'https://wa.me/' . Str::replaceFirst('+', '', $this->whatsapp_phone->formatE164());
68
+        return 'https://wa.me/'.Str::replaceFirst('+', '', $this->whatsapp_phone->formatE164());
69 69
     }
70 70
 
71 71
     /**
Please login to merge, or discard this patch.
app/Models/Concerns/Order/Event.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,13 +19,13 @@
 block discarded – undo
19 19
      */
20 20
     protected static function bootEvent()
21 21
     {
22
-        static::creating(function (Order $model) {
22
+        static::creating(function(Order $model) {
23 23
             if (is_null($model->code)) {
24 24
                 $model->code = $model->generateCode();
25 25
             }
26 26
         });
27 27
 
28
-        static::deleting(function (Order $model) {
28
+        static::deleting(function(Order $model) {
29 29
             $model->statuses->map->delete();
30 30
             $model->items->map->delete();
31 31
         });
Please login to merge, or discard this patch.