From 72fff055f4b816902bc59ba00e4683e07950b252 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Fri, 28 Jan 2022 17:36:32 +0100 Subject: [PATCH] Use Author::updateOrCreate instead of firstOrCreate --- app/Models/Tip.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Tip.php b/app/Models/Tip.php index 4180f46..3321f6d 100644 --- a/app/Models/Tip.php +++ b/app/Models/Tip.php @@ -75,7 +75,7 @@ class Tip extends Model 'content' => (string) Str::of($tweet->text)->explode("\n")->skip(1)->join("\n"), 'tweet_id' => $tweet->id, 'thread_slug' => $threadSlug ?? optional(Thread::firstWhere('tweet_id', $tweet->threadId))->slug, - 'author_username' => Author::firstOrCreate([ + 'author_username' => Author::updateOrCreate(['username' => $tweet->author->username], [ 'username' => $tweet->author->username, 'name' => $tweet->author->name, 'avatar' => $tweet->author->profile_image_url,