DONE: layout letter with letterhead and footer, notification for newly...

This commit is contained in:
ISMAIL MASSERAN
2026-06-28 02:16:49 +00:00
parent 94ecbe5887
commit 034ecf947f
400 changed files with 29802 additions and 5446 deletions
@@ -0,0 +1,49 @@
<?php
namespace App\Http\Controllers;
use App\Services\LetterService;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class LetterPreviewController extends Controller
{
public function __construct(protected LetterService $letterService) {}
/**
* Preview the base letter layout with sample content in the browser.
*
* GET /letters/preview?format=html|pdf
*/
public function show(Request $request): Response
{
if (! app()->environment('local', 'development')) {
abort(404);
}
$view = 'pdf.preview';
$format = $request->query('format', 'html');
if ($format === 'pdf') {
return $this->letterService->pdfResponse($view, [], 'letter-preview.pdf');
}
return $this->letterService->htmlResponse($view);
}
public function showMembershipApprovedLetter(Request $request): Response
{
if (! app()->environment('local', 'development')) {
abort(404);
}
$view = 'pdf.preview-approved-membership';
$format = $request->query('format', 'html');
if ($format === 'pdf') {
return $this->letterService->pdfResponse($view, [], 'letter-preview-approved-membership.pdf');
}
return $this->letterService->htmlResponse($view);
}
}