Ett ultimat VILT (Vue, Inertia, Laravel, Tailwind) startpaket för Laravel-applikationer.
Larasonic Vue är ett kraftfullt startpaket som kombinerar Laravel 11 på backend med Vue 3 och Inertia på frontend. Projektet är designat för att snabbt komma igång med moderna webbapplikationer med fokus på prestanda, säkerhet och användarupplevelse.
- PHP 8.3
- Laravel 11
- Laravel Octane för förbättrad prestanda
- Laravel Cashier för Stripe-integrering
- Laravel Jetstream för autentisering och teamhantering
- Laravel Sanctum för API-autentisering
- Laravel Socialite för OAuth-integration
- Vue 3.5
- Inertia.js för sömlös SPA-upplevelse utan att bygga en separat API
- Tailwind CSS 4 för styling
- Vite 6 för snabb utveckling och byggprocess
- Radix UI komponenter
- VeeValidate med Zod för formulärvalidering
- Laravel Pint för PHP-kodformatering
- PHPStan för statisk kodanalys
- Pest för testning
- ESLint för JavaScript/Vue-kodkvalitet
- Rector för automatiska koduppgraderingar
- Docker för containerisering
- Autentisering: Stöd för både traditionell inloggning, magic links och OAuth-providers
- Dashboard: Anpassningsbar användarportal
- Chattfunktionalitet: Inbyggd chattlösning
- Prenumerationshantering: Integration med Stripe för betalningar och prenumerationer
- SEO-optimering: Inbyggt stöd för meta-taggar och SEO-optimering
- Responsiv design: Fungerar på alla enheter
- PHP 8.3 eller högre
- Composer
- Node.js (eller Bun)
- MySQL/PostgreSQL/SQLite
-
Klona projektet
git clone https://github.com/alvex/Eplany_vue.git cd Eplany_vue -
Installera PHP-beroenden
composer install
-
Kopiera .env.example till .env och konfigurera miljövariabler
cp .env.example .env
-
Generera applikationsnyckel
php artisan key:generate
-
Installera JavaScript-beroenden och bygg frontend
bun install bun run build
-
Kör migrationer och seeders
php artisan migrate --seed
För att starta utvecklingsmiljön:
composer devDetta kommando startar:
- Laravel-servern
- Queue worker
- Loggvisare
- Vite-servern för hot-reloading
Alternativt kan du köra varje del separat:
# Laravel-server
php artisan serve
# Queue worker
php artisan queue:listen --tries=1
# Vite-server
npm run devFör att bygga projektet för produktion:
bun run buildProjektet innehåller Docker-konfiguration för enkel uppsättning:
docker-compose up -dViktiga miljövariabler att konfigurera i .env-filen:
APP_ENV: Miljö (local, production)APP_URL: Applikationens URLDB_CONNECTION: DatabastypSTRIPE_KEY&STRIPE_SECRET: För Stripe-integrationOAUTH_*: För OAuth-providers
Kör tester med:
composer testFormatera koden med:
composer formatAnalysera koden med:
composer analyseSuper-admin–only system for creating and managing SaaS billing invoices linked to a tenant's TenantSubscription. This is not tenant operational invoices (customers / jobs) — it is platform-level billing (e.g. manual charges, custom contracts).
Key points:
- All invoices belong to a
TenantSubscription(FK enforced). tenant_idis denormalised onbilling_invoicesfrom the subscription for safety.- Invoice templates are global (no
tenant_id). - PDF generation is on-demand using DomPDF (same library already used for subscription invoices).
| Method | URL | Name | Purpose |
|---|---|---|---|
| GET | /admin/billing/billing-invoices |
admin.billing.billing-invoices.index |
List all platform invoices |
| GET | /admin/billing/billing-invoices/create |
admin.billing.billing-invoices.create |
Create invoice form |
| POST | /admin/billing/billing-invoices |
admin.billing.billing-invoices.store |
Persist new invoice |
| GET | /admin/billing/billing-invoices/{id} |
admin.billing.billing-invoices.show |
View + HTML preview |
| GET | /admin/billing/billing-invoices/{id}/download |
admin.billing.billing-invoices.download |
Download PDF |
| GET | /admin/settings/invoice-templates |
admin.settings.invoice-templates.index |
List templates |
| GET | /admin/settings/invoice-templates/create |
admin.settings.invoice-templates.create |
Create template |
| POST | /admin/settings/invoice-templates |
admin.settings.invoice-templates.store |
Persist template |
| GET | /admin/settings/invoice-templates/{id}/edit |
admin.settings.invoice-templates.edit |
Edit template |
| PUT | /admin/settings/invoice-templates/{id} |
admin.settings.invoice-templates.update |
Update template |
| DELETE | /admin/settings/invoice-templates/{id} |
admin.settings.invoice-templates.destroy |
Delete template |
| POST | /admin/settings/invoice-templates/{id}/set-default |
admin.settings.invoice-templates.set-default |
Set as default |
| GET | /admin/settings/invoice-templates/{id}/preview |
admin.settings.invoice-templates.preview |
Render with sample data |
Templates use a minimal Mustache-like syntax. No PHP is ever evaluated from DB content.
Variables (dot-notation for nested keys):
{{invoice.number}} {{invoice.issue_date}} {{invoice.due_date}}
{{invoice.status}}
{{tenant.name}} {{tenant.id}}
{{subscription.plan_name}}
{{bill_to.name}} {{bill_to.email}}
{{totals.subtotal}} {{totals.tax}} {{totals.total}}
{{company.name}}
Loop over line items:
{{#items}}
<tr>
<td>{{description}}</td>
<td>{{quantity}}</td>
<td>{{unit_price}}</td>
<td>{{tax_rate}}</td>
<td>{{line_total}}</td>
</tr>
{{/items}}| Rule | Detail |
|---|---|
| No server-side PHP execution | Templates are plain HTML strings. Never passed to eval() or Blade's compiler. |
<script> tags stripped |
Removed from rendered HTML before display and before PDF generation. |
| Inline event handlers removed | on* attributes (onclick, onload, …) stripped at render time. |
javascript: URIs blocked |
Replaced with # in href/src/action attributes. |
| JS field stored only | invoice_templates.js is stored for reference but never injected into preview HTML or PDF. |
| Preview via sandboxed iframe | Admin preview is rendered inside <iframe sandbox="allow-same-origin"> — no script execution. |
| PDF ignores JS | DomPDF renders HTML+CSS only; JS is absent from the rendered document passed to DomPDF. |
All amounts are stored in cents (integer). Tax rates are stored in basis points (bps): 2500 bps = 25.00%. Totals are always computed server-side — client-submitted totals are ignored.
Platform invoices use the series BILL- (e.g. BILL-000001). The sequence is stored in invoice_number_sequences (same table as SUB- series). The BillingInvoiceSeeder seeds this sequence and the default template on first run.
| Table | Purpose |
|---|---|
invoice_templates |
Global invoice templates (name, html, css, js, is_default) |
billing_invoices |
Platform billing invoices per TenantSubscription |
billing_invoice_items |
Line items for each billing invoice |
- Invoice status starts as
draft. Status transitions (draft→sent→paid→void) are available viaInvoiceStatusRulesbut no UI button is provided in v1 — can be added as a follow-up. - Email delivery is not implemented for platform invoices in v1 (unlike subscription invoices which use
GeneratePdfAndNotify). PDF is generated on-demand at download time. - bill_to_name / bill_to_email are snapshot fields — captured at creation time. They do not update if the tenant's billing profile changes.
- Template JS is stored to allow teams to keep JS notes alongside the template, but it is never executed. This is clearly documented in the UI with a warning.
- Default template enforcement: only one template can be
is_default=true. This is enforced at the application layer (DB transaction) rather than a DB partial-unique index, to keep the migration simple. - PDF is generated on first download, not asynchronously. For large invoice volumes a queue-based approach (like
GeneratePdfAndNotify) should be added.