1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 13:24:03 +00:00

PHP 7.4 support

This commit is contained in:
Samuel Štancl 2021-10-10 18:32:00 +02:00 committed by GitHub
parent 69d86147d7
commit 77585aa962
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,7 +74,7 @@ class Tip extends Model
'title' => (string) Str::of(Str::of($tweet->text)->explode("\n")->first())->rtrim('.')->replaceMatches('/^([^a-zA-Z]*)/', ''), // remove any non-ascii characters from the beginning
'content' => (string) Str::of($tweet->text)->explode("\n")->skip(1)->join("\n"),
'tweet_id' => $tweet->id,
'thread_slug' => $threadSlug ?? Thread::firstWhere('tweet_id', $tweet->threadId)?->slug,
'thread_slug' => $threadSlug ?? optional(Thread::firstWhere('tweet_id', $tweet->threadId))->slug,
'author_username' => Author::firstOrCreate([
'username' => $tweet->author->username,
'name' => $tweet->author->name,