Passed
Push — master ( d6e650...30012e )
by Thomas
06:40
created
app/Http/Controllers/Admin/ScheduledPaymentCrudController.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     public function setup()
31 31
     {
32 32
         CRUD::setModel(\App\Models\ScheduledPayment::class);
33
-        CRUD::setRoute(config('backpack.base.route_prefix') . '/scheduled-payment');
33
+        CRUD::setRoute(config('backpack.base.route_prefix').'/scheduled-payment');
34 34
         CRUD::setEntityNameStrings(__('scheduled payment'), __('scheduled payments'));
35 35
         CRUD::enableExportButtons();
36 36
     }
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
             'attribute' => 'lastname',
50 50
             'label' => __('Last Name'),
51 51
             'type' => 'relationship',
52
-            'searchLogic' => function ($query, $column, $searchTerm) {
53
-                $query->orWhereHas('enrollment', function ($q) use ($searchTerm) {
54
-                    $q->whereHas('user', function ($q) use ($searchTerm) {
52
+            'searchLogic' => function($query, $column, $searchTerm) {
53
+                $query->orWhereHas('enrollment', function($q) use ($searchTerm) {
54
+                    $q->whereHas('user', function($q) use ($searchTerm) {
55 55
                         $q->where('lastname', 'like', '%'.$searchTerm.'%');
56 56
                     });
57 57
                 });
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
             'attribute' => 'firstname',
65 65
             'label' => __('First Name'),
66 66
             'type' => 'relationship',
67
-            'searchLogic' => function ($query, $column, $searchTerm) {
68
-                $query->orWhereHas('enrollment', function ($q) use ($searchTerm) {
69
-                    $q->whereHas('user', function ($q) use ($searchTerm) {
67
+            'searchLogic' => function($query, $column, $searchTerm) {
68
+                $query->orWhereHas('enrollment', function($q) use ($searchTerm) {
69
+                    $q->whereHas('user', function($q) use ($searchTerm) {
70 70
                         $q->where('firstname', 'like', '%'.$searchTerm.'%');
71 71
                     });
72 72
                 });
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
             'attribute' => 'email',
81 81
             'label' => __('Email'),
82 82
             'type' => 'relationship',
83
-            'searchLogic' => function ($query, $column, $searchTerm) {
84
-                $query->orWhereHas('enrollment', function ($q) use ($searchTerm) {
85
-                    $q->whereHas('user', function ($q) use ($searchTerm) {
83
+            'searchLogic' => function($query, $column, $searchTerm) {
84
+                $query->orWhereHas('enrollment', function($q) use ($searchTerm) {
85
+                    $q->whereHas('user', function($q) use ($searchTerm) {
86 86
                         $q->where('email', 'like', '%'.$searchTerm.'%');
87 87
                     });
88 88
                 });
@@ -112,13 +112,13 @@  discard block
 block discarded – undo
112 112
             'name' => 'status_id',
113 113
             'type' => 'select2',
114 114
             'label'=> __('Status'),
115
-        ], function () {
115
+        ], function() {
116 116
             return [
117 117
                 1 => __('Pending'),
118 118
                 2 => __('Paid'),
119 119
             ];
120 120
         },
121
-            function ($value) { // if the filter is active
121
+            function($value) { // if the filter is active
122 122
                 CRUD::addClause('status', $value);
123 123
             });
124 124
     }
Please login to merge, or discard this patch.
app/Models/ScheduledPayment.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
     public function scopeStatus(Builder $query, $status)
64 64
     {
65
-        return match ($status) {
65
+        return match($status) {
66 66
             "2" => $query->where('status', 2)->orWhereHas('invoices'),
67 67
             "1" => $query->where('status', 1)->orWhereDoesntHave('invoices'),
68 68
             default => $query,
@@ -111,10 +111,10 @@  discard block
 block discarded – undo
111 111
     {
112 112
         if (config('app.currency_position') === 'before')
113 113
         {
114
-            return config('app.currency_symbol') . " ". $this->value;
114
+            return config('app.currency_symbol')." ".$this->value;
115 115
         }
116 116
 
117
-        return $this->value . " " . config('app.currency_symbol');
117
+        return $this->value." ".config('app.currency_symbol');
118 118
     }
119 119
 
120 120
     function getDateForHumansAttribute()
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
     public function identifiableAttribute()
142 142
     {
143
-        return $this->date . " (" . $this->value_with_currency . ")";
143
+        return $this->date." (".$this->value_with_currency.")";
144 144
     }
145 145
 
146 146
     public function getStatusTypeNameAttribute()
Please login to merge, or discard this patch.