Christian Giupponi
Christian Giupponi
FFilament
Created by Christian Giupponi on 1/19/2024 in #❓┊help
import csv and generate slug before save the post
I need to generate a slug while the records are imported. I tried to use beforeCreate function but can't find any example about how to use it. I tried:
protected function beforeCreate() : void
{
$this->data['slug'] = Str::slug($this->data['name']);
}
protected function beforeCreate() : void
{
$this->data['slug'] = Str::slug($this->data['name']);
}
but does not seems to work, when import the data I get a sql error because of missing slug.
6 replies