File tree 2 files changed +11
-6
lines changed
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,12 @@ public function __construct(Workflow $model)
16
16
public function all ()
17
17
{
18
18
$ workflows = $ this ->model ->with (['transitions ' , 'states ' ])->get ();
19
+ $ config = collect ([]);
20
+ foreach ($ workflows as $ workflow ) {
21
+ $ config = $ config ->merge ($ this ->makeWorkflowCofig ($ workflow ));
22
+ }
19
23
20
- return $ workflows ->map (function ($ workflow ) {
21
- return $ this ->makeWorkflowCofig ($ workflow );
22
- })->toArray ();
24
+ return $ config ->toArray ();
23
25
}
24
26
25
27
public function find ($ id )
Original file line number Diff line number Diff line change @@ -31,8 +31,11 @@ public function all(): array
31
31
return [];
32
32
}
33
33
34
- return collect ($ this ->loaders )->mapWithKeys (function ($ loader ) {
35
- return [$ loader ::class => $ loader ->all ()];
36
- })->toArray ();
34
+ $ workflows = collect ([]);
35
+ foreach ($ this ->loaders as $ loader ) {
36
+ $ workflows = $ workflows ->merge (collect ($ loader ->all ()));
37
+ }
38
+
39
+ return $ workflows ->toArray ();
37
40
}
38
41
}
You can’t perform that action at this time.
0 commit comments