You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
topnotch_website/app/Filament/Resources/InvoiceResource/Pages/CreateInvoice.php

22 lines
508 B
PHTML

2 months ago
<?php
namespace App\Filament\Resources\InvoiceResource\Pages;
use App\Filament\Resources\InvoiceResource;
use App\Models\Invoice;
2 months ago
use Filament\Resources\Pages\CreateRecord;
use Illuminate\Database\Eloquent\Model;
2 months ago
class CreateInvoice extends CreateRecord
{
protected static string $resource = InvoiceResource::class;
protected function handleRecordCreation(array $data): Model
{
$invoice = Invoice::create($data);
$invoice->calculateTotals();
return $invoice;
}
2 months ago
}