Answer the question
In order to leave comments, you need to log in
How to force in crop to use a mutator?
Seyu DB through the factory.
I want a mutator to be used when creating the slug field,
public function setSlugAttribute($value)
{
$this->attributes['slug'] = Str::slug($value, '-');
}
$productTitle = $request->title;
$product->slug = $productTitle;
'title' => $this->faker->words(3, true),
'slug' => ???????
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question