Deploy Ladill Woo Manager / deploy (push) Failing after 2s
Standalone app with SSO shell, WordPress plugin connect flow, webhook ingest, fulfillment inbox, and plugin activation API — no payment processing. Co-authored-by: Cursor <cursoragent@cursor.com>
44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Support\Invoice;
|
|
|
|
class InvoiceTemplateCatalog
|
|
{
|
|
/** @return array<string, string> */
|
|
public static function labels(): array
|
|
{
|
|
return [
|
|
'classic' => 'Classic',
|
|
'modern' => 'Modern',
|
|
'minimal' => 'Minimal',
|
|
'bold' => 'Bold',
|
|
'professional' => 'Professional',
|
|
];
|
|
}
|
|
|
|
public static function isValid(string $template): bool
|
|
{
|
|
return array_key_exists($template, self::labels());
|
|
}
|
|
|
|
public static function default(): string
|
|
{
|
|
return 'classic';
|
|
}
|
|
|
|
public static function view(string $template): string
|
|
{
|
|
$template = self::isValid($template) ? $template : self::default();
|
|
|
|
return 'invoices.templates.'.$template;
|
|
}
|
|
|
|
/** Preview thumbnail URL for a template (public/images/invoice-templates/<key>.svg). */
|
|
public static function thumbnail(string $template): string
|
|
{
|
|
$template = self::isValid($template) ? $template : self::default();
|
|
|
|
return asset('images/invoice-templates/'.$template.'.svg');
|
|
}
|
|
}
|