adrema/app/Pdf/MemberPdfController.php

22 lines
461 B
PHP
Raw Normal View History

2021-07-15 21:17:48 +02:00
<?php
namespace App\Pdf;
use App\Http\Controllers\Controller;
use App\Member\Member;
use Illuminate\Http\Request;
class MemberPdfController extends Controller
{
public function __invoke(Request $request, Member $member)
{
$repo = app(PdfRepositoryFactory::class)->fromSingleRequest($request->type, $member);
return $repo === null
? response()->noContent()
: app(PdfGenerator::class)->render($repo);
}
}