#40 - generate pdf for vacation request #46

Merged
Baakoma merged 5 commits from #40-generate-pdf-for-vacation-request into main 2022-02-04 10:57:11 +01:00
Showing only changes of commit a0cedeb752 - Show all commits

View File

@@ -5,8 +5,10 @@ declare(strict_types=1);
namespace Toby\Infrastructure\Http\Requests; namespace Toby\Infrastructure\Http\Requests;
use Illuminate\Foundation\Http\FormRequest; use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Carbon;
use Illuminate\Validation\Rules\Enum; use Illuminate\Validation\Rules\Enum;
use Toby\Domain\Enums\VacationType; use Toby\Domain\Enums\VacationType;
use Toby\Eloquent\Models\YearPeriod;
use Toby\Infrastructure\Http\Rules\YearPeriodExists; use Toby\Infrastructure\Http\Rules\YearPeriodExists;
class VacationRequestRequest extends FormRequest class VacationRequestRequest extends FormRequest
@@ -23,10 +25,13 @@ class VacationRequestRequest extends FormRequest
public function data(): array public function data(): array
{ {
$from = $this->get("from");
return [ return [
"type" => $this->get("type"), "type" => $this->get("type"),
"from" => $this->get("from"), "from" => $from,
"to" => $this->get("to"), "to" => $this->get("to"),
"year_period_id" => YearPeriod::findByYear(Carbon::create($from)->year)->id,
"comment" => $this->get("comment"), "comment" => $this->get("comment"),
]; ];
} }