adrema/app/Contribution/ContributionController.php

32 lines
756 B
PHP
Raw Normal View History

2022-05-17 01:37:07 +02:00
<?php
namespace App\Contribution;
use App\Http\Controllers\Controller;
use App\Member\Member;
use App\Member\MemberResource;
use App\Pdf\PdfGenerator;
use Illuminate\Http\Request;
use Inertia\Inertia;
use Inertia\Response;
class ContributionController extends Controller
{
public function form(): Response
{
session()->put('menu', 'contribution');
session()->put('title', 'Zuschüsse');
return Inertia::render('contribution/VIndex', [
2022-05-20 01:18:11 +02:00
'allMembers' => MemberResource::collection(Member::get()),
2022-05-17 01:37:07 +02:00
]);
}
public function generate(Request $request): PdfGenerator
{
$data = app($request->query('type'));
return app(PdfGenerator::class)->setRepository($data)->render();
}
}