<?php
 namespace App\EventHooks\System; use App\EventHooks\HookEvent; use App\Models\Order; class ContractAccepted extends HookEvent { public const HOOK = 'DistanceSellingContractAccepted'; public function orderId(): ?int { $id = $this->get('order_id') ?? $this->get('orderid'); return $id ? (int) $id : null; } public function order(): ?Order { $id = $this->orderId(); return $id ? Order::find($id) : null; } public function contractTitle(): ?string { return $this->get('contract_title'); } } 