feat: updates on sales
This commit is contained in:
@@ -3,9 +3,27 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user