F
Filament11mo ago
DGINX

Skip Import when model is existing

Hello is it possible to skip a row during import when model is already existing?
1 Reply
DGINX
DGINXOP11mo ago
Ok i find it by myself out. Easily return null in resolveRecord() Function
public function resolveRecord(): ?User
{
if ($this->options['existingAction'] === "skip") {
if(User::whereName($this->data['name'])->first())
return null;
}

return new User();
}
public function resolveRecord(): ?User
{
if ($this->options['existingAction'] === "skip") {
if(User::whereName($this->data['name'])->first())
return null;
}

return new User();
}
Want results from more Discord servers?
Add your server