1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 05:14:04 +00:00
This commit is contained in:
Samuel Štancl 2021-04-06 22:03:15 +02:00
parent 8dae8d1250
commit 481dd3c3fb
2 changed files with 2 additions and 2 deletions

View file

@ -68,7 +68,7 @@ class Tip extends Model
return array_map(fn (string $url) => new TwitterImage($url), $this->images);
}
public static function fromTweet(Tweet $tweet, string $threadSlug = null): static
public static function fromTweet(Tweet $tweet, string $threadSlug = null): self
{
return new static([
'title' => (string) Str::of(Str::of($tweet->text)->explode("\n")->first())->rtrim('.')->replaceMatches('/^([^a-zA-Z]*)/', ''), // remove any non-ascii characters from the beginning