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
PHP

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