1
0
Fork 0

Update StatusTagsPipeline, fix object tags slug query

This commit is contained in:
Daniel Supernault 2023-09-25 05:13:09 -06:00 committed by chris
parent 5776887ca8
commit 5934e88d76
1 changed files with 9 additions and 8 deletions

View File

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