mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-26 06:53:17 +00:00
Update StatusTagsPipeline, fix object tags slug query
This commit is contained in:
parent
bf5b72f082
commit
9989d6c66f
1 changed files with 9 additions and 8 deletions
|
@ -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
|
||||
]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue