Update StatusTagsPipeline, fix object tags slug query

This commit is contained in:
Daniel Supernault 2023-09-25 05:13:09 -06:00
parent bf5b72f082
commit 9989d6c66f
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -82,13 +82,14 @@ class StatusTagsPipeline implements ShouldQueue
->first();
if(!$hashtag) {
$hashtag = new Hashtag;
$hashtag->name = $name;
$hashtag->slug = str_slug($name, '-', false);
$hashtag->save();
$hashtag = Hashtag::updateOrCreate([
'slug' => str_slug($name, '-', false),
],[
'name' => $name
]);
}
} else {
$hashtag = Hashtag::firstOrCreate([
$hashtag = Hashtag::updateOrCreate([
'slug' => str_slug($name, '-', false),
],[
'name' => $name