class SiteFullImporter extends Importer
{
public function resolveRecord(): ?Target
{
return Target::firstOrNew([
'name' => $this->data['name'],
'address' => $this->data['address'],
'format' => $this->data['format'],
'size' => $this->data['size'],
'total_unit' => $this->data['total_unit'],
'estimate_traffic_per_month' => $this->data['estimate_traffic_per_month'],
'latitude' => $this->data['latitude'],
'longitude' => $this->data['longitude'],
]);
}
protected function afterCreate(): void
{
$this->record->rate_card()->create([
'rate_card_1_month' => 0,
'rate_card_3_months' => 0,
'rate_card_6_months' => 0,
'rate_card_12_months' => 0,
]);
}