Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 14s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Laravel Larastan / larastan (pull_request) Failing after 4m48s
Laravel Pint / pint (pull_request) Successful in 3m50s
39 lines
1.3 KiB
PHP
39 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\PanelGrMasterResource\Pages;
|
|
|
|
use App\Filament\Resources\PanelGrMasterResource;
|
|
use App\Models\PanelGrMaster;
|
|
use Filament\Actions;
|
|
use Filament\Notifications\Notification;
|
|
use Filament\Resources\Pages\CreateRecord;
|
|
use Illuminate\Validation\ValidationException;
|
|
|
|
class CreatePanelGrMaster extends CreateRecord
|
|
{
|
|
protected static string $resource = PanelGrMasterResource::class;
|
|
|
|
// protected function mutateFormDataBeforeCreate(array $data): array
|
|
// {
|
|
// $exists = PanelGrMaster::where('plant_id', $data['plant_id'])
|
|
// ->where('item_id', $data['item_id'])
|
|
// ->where('document_number', $data['document_number'])
|
|
// ->where('invoice_number', $data['invoice_number'])
|
|
// ->where('supplier_number', $data['supplier_number'])
|
|
// ->exists();
|
|
|
|
// if ($exists) {
|
|
// Notification::make()
|
|
// ->title('Duplicate Record')
|
|
// ->body('This combination already exists in Master.')
|
|
// ->danger()
|
|
// ->send();
|
|
// throw ValidationException::withMessages([
|
|
// 'item_id' => 'This combination already exists in Master.',
|
|
// ]);
|
|
// }
|
|
|
|
// return $data;
|
|
// }
|
|
}
|