Field 'slug' doesn't have a default value
NicTorgersen opened this issue · comments
Nic commented
I'm using laravel/framework v8.16.0
and spatie/laravel-tags v2.7.2
after I ran a composer update
and my tests fail with Field 'slug' doesn't have a default value
. It worked fine until I ran an update.
I'm using the $model->syncTagsWithType(array, string)
method to add tags to my model.
My config looks like this:
<?php
return [
/*
* The given function generates a URL friendly "slug" from the tag name property before saving it.
* Defaults to Str::slug (https://laravel.com/docs/5.8/helpers#method-str-slug)
*/
'slugger' => null,
];
composer.json:
{
"require": {
"laravel/framework": "^8.0",
"spatie/laravel-tags": "^2.7"
}
}
Nic commented
My mistake. Managed to suppress events and noticed boot() uses creating-event to add a slug.
Robert Kabat commented
Very well spotted dude. It was driving me insane the entire morning.