adrema/app/Payment/ActionFactory.php

24 lines
573 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;
use App\Letter\Letter;
2021-07-17 16:57:37 +02:00
use Illuminate\Support\Collection;
class ActionFactory
{
2021-07-17 18:46:02 +02:00
public function allLinks(): Collection
{
2022-11-07 16:18:11 +01:00
return app(DocumentFactory::class)->getTypes()->map(function (Letter $repo) {
2021-07-17 18:46:02 +02:00
return [
2021-10-29 21:44:23 +02:00
'link' => [
'href' => route('sendpayment.pdf', ['type' => get_class($repo)]),
2022-11-07 16:18:11 +01:00
'label' => $repo->sendAllLabel(),
2021-10-29 21:44:23 +02:00
],
'text' => $repo->getDescription(),
2021-07-17 18:46:02 +02:00
];
});
}
2021-07-17 16:57:37 +02:00
}