File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
Expand file tree Collapse file tree 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)
1616 public function all ()
1717 {
1818 $ workflows = $ this ->model ->with (['transitions ' , 'states ' ])->get ();
19+ $ config = collect ([]);
20+ foreach ($ workflows as $ workflow ) {
21+ $ config = $ config ->merge ($ this ->makeWorkflowCofig ($ workflow ));
22+ }
1923
20- return $ workflows ->map (function ($ workflow ) {
21- return $ this ->makeWorkflowCofig ($ workflow );
22- })->toArray ();
24+ return $ config ->toArray ();
2325 }
2426
2527 public function find ($ id )
Original file line number Diff line number Diff line change @@ -31,8 +31,11 @@ public function all(): array
3131 return [];
3232 }
3333
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 ();
3740 }
3841}
You can’t perform that action at this time.
0 commit comments