30 lines
721 B
PHP
30 lines
721 B
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\SaleResource\Pages;
|
|
|
|
use App\Filament\Resources\SaleResource;
|
|
use App\Models\Branch;
|
|
use Filament\Resources\Pages\CreateRecord;
|
|
use Illuminate\Support\Arr;
|
|
|
|
class CreateSale extends CreateRecord
|
|
{
|
|
protected static string $resource = SaleResource::class;
|
|
|
|
protected function mutateFormDataBeforeCreate(array $data): array
|
|
{
|
|
return $this->getFormDataMutation($data);
|
|
}
|
|
|
|
public function getFormDataMutation(array $data): array
|
|
{
|
|
return Arr::except($data, ['client', 'transactions', 'with_discount']);
|
|
}
|
|
|
|
protected function afterCreate(): void
|
|
{
|
|
$branch = Branch::find($this->data['branch_id']);
|
|
dd($branch);
|
|
}
|
|
}
|