Scaffold Ladill Woo Manager for WooCommerce order fulfillment.
Deploy Ladill Woo Manager / deploy (push) Failing after 2s
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>
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user