where('category', $data['category']) ->where('status', 'active') ->first(); if ($existing) { Notification::make() ->title(__('feedback.contract_duplicate_title', [ 'category' => \App\Enums\ContractCategory::from($data['category'])->label(), ])) ->body(__('feedback.contract_duplicate_body', [ 'product' => $existing->product?->name ?? '?', 'customer' => $existing->customer?->name ?? '?', ])) ->warning() ->send(); $this->halt(); } } return $data; } }