adrema/app/Payment/ActionFactory.php

26 lines
640 B
PHP
Raw Normal View History

2021-07-17 16:57:37 +02:00
<?php
namespace App\Payment;
2022-11-07 16:18:11 +01:00
use App\Letter\DocumentFactory;
2021-07-17 16:57:37 +02:00
use Illuminate\Support\Collection;
class ActionFactory
{
2023-02-17 18:57:11 +01:00
/**
* @return Collection<int, array{link: array{href: string, label: mixed}, text: mixed}>
*/
2021-07-17 18:46:02 +02:00
public function allLinks(): Collection
{
2022-12-07 00:40:53 +01:00
return app(DocumentFactory::class)->getTypes()->map(function ($repo) {
2021-07-17 18:46:02 +02:00
return [
2021-10-29 21:44:23 +02:00
'link' => [
2022-12-07 00:40:53 +01:00
'href' => route('sendpayment.pdf', ['type' => $repo]),
'label' => $repo::sendAllLabel(),
2021-10-29 21:44:23 +02:00
],
2022-12-07 00:40:53 +01:00
'text' => $repo::getDescription(),
2021-07-17 18:46:02 +02:00
];
});
}
2021-07-17 16:57:37 +02:00
}