@@ -202,7 +202,7 @@ |
||
202 | 202 | { |
203 | 203 | $ruleGroup->rules()->whereNotNull('deleted_at')->update(['order' => 0]); |
204 | 204 | |
205 | - $set = $ruleGroup->rules() |
|
205 | + $set = $ruleGroup->rules() |
|
206 | 206 | ->orderBy('order', 'ASC') |
207 | 207 | ->orderBy('updated_at', 'DESC') |
208 | 208 | ->get(); |
@@ -98,16 +98,16 @@ discard block |
||
98 | 98 | public function getForImport(): Collection |
99 | 99 | { |
100 | 100 | return Rule::distinct() |
101 | - ->where('rules.user_id', $this->user->id) |
|
102 | - ->leftJoin('rule_groups', 'rule_groups.id', '=', 'rules.rule_group_id') |
|
103 | - ->leftJoin('rule_triggers', 'rules.id', '=', 'rule_triggers.rule_id') |
|
104 | - ->where('rule_groups.active', 1) |
|
105 | - ->where('rule_triggers.trigger_type', 'user_action') |
|
106 | - ->where('rule_triggers.trigger_value', 'store-journal') |
|
107 | - ->where('rules.active', 1) |
|
108 | - ->orderBy('rule_groups.order', 'ASC') |
|
109 | - ->orderBy('rules.order', 'ASC') |
|
110 | - ->get(['rules.*', 'rule_groups.order']); |
|
101 | + ->where('rules.user_id', $this->user->id) |
|
102 | + ->leftJoin('rule_groups', 'rule_groups.id', '=', 'rules.rule_group_id') |
|
103 | + ->leftJoin('rule_triggers', 'rules.id', '=', 'rule_triggers.rule_id') |
|
104 | + ->where('rule_groups.active', 1) |
|
105 | + ->where('rule_triggers.trigger_type', 'user_action') |
|
106 | + ->where('rule_triggers.trigger_value', 'store-journal') |
|
107 | + ->where('rules.active', 1) |
|
108 | + ->orderBy('rule_groups.order', 'ASC') |
|
109 | + ->orderBy('rules.order', 'ASC') |
|
110 | + ->get(['rules.*', 'rule_groups.order']); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -237,9 +237,9 @@ discard block |
||
237 | 237 | $ruleGroup->rules()->whereNotNull('deleted_at')->update(['order' => 0]); |
238 | 238 | |
239 | 239 | $set = $ruleGroup->rules() |
240 | - ->orderBy('order', 'ASC') |
|
241 | - ->orderBy('updated_at', 'DESC') |
|
242 | - ->get(); |
|
240 | + ->orderBy('order', 'ASC') |
|
241 | + ->orderBy('updated_at', 'DESC') |
|
242 | + ->get(); |
|
243 | 243 | $count = 1; |
244 | 244 | /** @var Rule $entry */ |
245 | 245 | foreach ($set as $entry) { |
@@ -124,15 +124,15 @@ discard block |
||
124 | 124 | ->orderBy('order', 'ASC') |
125 | 125 | ->with( |
126 | 126 | [ |
127 | - 'rules' => function (HasMany $query) { |
|
127 | + 'rules' => function(HasMany $query) { |
|
128 | 128 | $query->orderBy('active', 'DESC'); |
129 | 129 | $query->orderBy('order', 'ASC'); |
130 | 130 | |
131 | 131 | }, |
132 | - 'rules.ruleTriggers' => function (HasMany $query) { |
|
132 | + 'rules.ruleTriggers' => function(HasMany $query) { |
|
133 | 133 | $query->orderBy('order', 'ASC'); |
134 | 134 | }, |
135 | - 'rules.ruleActions' => function (HasMany $query) { |
|
135 | + 'rules.ruleActions' => function(HasMany $query) { |
|
136 | 136 | $query->orderBy('order', 'ASC'); |
137 | 137 | }, |
138 | 138 | ] |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | { |
215 | 215 | $ruleGroup->rules()->whereNotNull('deleted_at')->update(['order' => 0]); |
216 | 216 | |
217 | - $set = $ruleGroup->rules() |
|
217 | + $set = $ruleGroup->rules() |
|
218 | 218 | ->orderBy('order', 'ASC') |
219 | 219 | ->orderBy('updated_at', 'DESC') |
220 | 220 | ->get(); |
@@ -126,8 +126,8 @@ discard block |
||
126 | 126 | public function getActiveRules(RuleGroup $group): Collection |
127 | 127 | { |
128 | 128 | return $group->rules() |
129 | - ->where('rules.active', 1) |
|
130 | - ->get(['rules.*']); |
|
129 | + ->where('rules.active', 1) |
|
130 | + ->get(['rules.*']); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -138,11 +138,11 @@ discard block |
||
138 | 138 | public function getActiveStoreRules(RuleGroup $group): Collection |
139 | 139 | { |
140 | 140 | return $group->rules() |
141 | - ->leftJoin('rule_triggers', 'rules.id', '=', 'rule_triggers.rule_id') |
|
142 | - ->where('rule_triggers.trigger_type', 'user_action') |
|
143 | - ->where('rule_triggers.trigger_value', 'store-journal') |
|
144 | - ->where('rules.active', 1) |
|
145 | - ->get(['rules.*']); |
|
141 | + ->leftJoin('rule_triggers', 'rules.id', '=', 'rule_triggers.rule_id') |
|
142 | + ->where('rule_triggers.trigger_type', 'user_action') |
|
143 | + ->where('rule_triggers.trigger_value', 'store-journal') |
|
144 | + ->where('rules.active', 1) |
|
145 | + ->get(['rules.*']); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | /** |
@@ -153,11 +153,11 @@ discard block |
||
153 | 153 | public function getActiveUpdateRules(RuleGroup $group): Collection |
154 | 154 | { |
155 | 155 | return $group->rules() |
156 | - ->leftJoin('rule_triggers', 'rules.id', '=', 'rule_triggers.rule_id') |
|
157 | - ->where('rule_triggers.trigger_type', 'user_action') |
|
158 | - ->where('rule_triggers.trigger_value', 'update-journal') |
|
159 | - ->where('rules.active', 1) |
|
160 | - ->get(['rules.*']); |
|
156 | + ->leftJoin('rule_triggers', 'rules.id', '=', 'rule_triggers.rule_id') |
|
157 | + ->where('rule_triggers.trigger_type', 'user_action') |
|
158 | + ->where('rule_triggers.trigger_value', 'update-journal') |
|
159 | + ->where('rules.active', 1) |
|
160 | + ->get(['rules.*']); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | public function getRules(RuleGroup $group): Collection |
205 | 205 | { |
206 | 206 | return $group->rules() |
207 | - ->get(['rules.*']); |
|
207 | + ->get(['rules.*']); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | /** |
@@ -282,9 +282,9 @@ discard block |
||
282 | 282 | $ruleGroup->rules()->whereNotNull('deleted_at')->update(['order' => 0]); |
283 | 283 | |
284 | 284 | $set = $ruleGroup->rules() |
285 | - ->orderBy('order', 'ASC') |
|
286 | - ->orderBy('updated_at', 'DESC') |
|
287 | - ->get(); |
|
285 | + ->orderBy('order', 'ASC') |
|
286 | + ->orderBy('updated_at', 'DESC') |
|
287 | + ->get(); |
|
288 | 288 | $count = 1; |
289 | 289 | /** @var Rule $entry */ |
290 | 290 | foreach ($set as $entry) { |
@@ -65,7 +65,7 @@ |
||
65 | 65 | public function getCategories(): Collection |
66 | 66 | { |
67 | 67 | $set = $this->categories->sortBy( |
68 | - function (CategoryModel $category) { |
|
68 | + function(CategoryModel $category) { |
|
69 | 69 | return $category->spent; |
70 | 70 | } |
71 | 71 | ); |
@@ -170,11 +170,11 @@ |
||
170 | 170 | { |
171 | 171 | // Find all rules belonging to this rulegroup |
172 | 172 | $rules = $this->ruleGroup->rules() |
173 | - ->leftJoin('rule_triggers', 'rules.id', '=', 'rule_triggers.rule_id') |
|
174 | - ->where('rule_triggers.trigger_type', 'user_action') |
|
175 | - ->where('rule_triggers.trigger_value', 'store-journal') |
|
176 | - ->where('rules.active', 1) |
|
177 | - ->get(['rules.*']); |
|
173 | + ->leftJoin('rule_triggers', 'rules.id', '=', 'rule_triggers.rule_id') |
|
174 | + ->where('rule_triggers.trigger_type', 'user_action') |
|
175 | + ->where('rule_triggers.trigger_value', 'store-journal') |
|
176 | + ->where('rules.active', 1) |
|
177 | + ->get(['rules.*']); |
|
178 | 178 | |
179 | 179 | // Create a list of processors for these rules |
180 | 180 | return array_map( |
@@ -199,7 +199,7 @@ |
||
199 | 199 | |
200 | 200 | // Create a list of processors for these rules |
201 | 201 | return array_map( |
202 | - function ($rule) { |
|
202 | + function($rule) { |
|
203 | 203 | /** @var Processor $processor */ |
204 | 204 | $processor = app(Processor::class); |
205 | 205 | $processor->make($rule); |
@@ -46,7 +46,7 @@ |
||
46 | 46 | { |
47 | 47 | $this->app->bind( |
48 | 48 | RuleGroupRepositoryInterface::class, |
49 | - function (Application $app) { |
|
49 | + function(Application $app) { |
|
50 | 50 | /** @var RuleGroupRepository $repository */ |
51 | 51 | $repository = app(RuleGroupRepository::class); |
52 | 52 | if ($app->auth->check()) { |
@@ -45,7 +45,7 @@ |
||
45 | 45 | { |
46 | 46 | $this->app->bind( |
47 | 47 | CurrencyRepositoryInterface::class, |
48 | - function (Application $app) { |
|
48 | + function(Application $app) { |
|
49 | 49 | /** @var CurrencyRepository $repository */ |
50 | 50 | $repository = app(CurrencyRepository::class); |
51 | 51 | if ($app->auth->check()) { |
@@ -45,7 +45,7 @@ |
||
45 | 45 | { |
46 | 46 | $this->app->bind( |
47 | 47 | BudgetRepositoryInterface::class, |
48 | - function (Application $app) { |
|
48 | + function(Application $app) { |
|
49 | 49 | /** @var BudgetRepositoryInterface $repository */ |
50 | 50 | $repository = app(BudgetRepository::class); |
51 | 51 | if ($app->auth->check()) { |
@@ -45,7 +45,7 @@ |
||
45 | 45 | { |
46 | 46 | $this->app->bind( |
47 | 47 | CategoryRepositoryInterface::class, |
48 | - function (Application $app) { |
|
48 | + function(Application $app) { |
|
49 | 49 | /** @var CategoryRepository $repository */ |
50 | 50 | $repository = app(CategoryRepository::class); |
51 | 51 | if ($app->auth->check()) { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | { |
57 | 57 | $this->app->bind( |
58 | 58 | AccountRepositoryInterface::class, |
59 | - function (Application $app) { |
|
59 | + function(Application $app) { |
|
60 | 60 | /** @var AccountRepositoryInterface $repository */ |
61 | 61 | $repository = app(AccountRepository::class); |
62 | 62 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | { |
77 | 77 | $this->app->bind( |
78 | 78 | AccountTaskerInterface::class, |
79 | - function (Application $app) { |
|
79 | + function(Application $app) { |
|
80 | 80 | /** @var AccountTaskerInterface $tasker */ |
81 | 81 | $tasker = app(AccountTasker::class); |
82 | 82 |