1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 13:24:03 +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); 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([ 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 'title' => (string) Str::of(Str::of($tweet->text)->explode("\n")->first())->rtrim('.')->replaceMatches('/^([^a-zA-Z]*)/', ''), // remove any non-ascii characters from the beginning

View file

@ -1,4 +1,4 @@
<x:layout :title="$tip->title"> <x:layout :title="$tip->title" :preview="$tip->content">
<main class="mx-auto flex justify-between items-center gap-8"> <main class="mx-auto flex justify-between items-center gap-8">
<aside class="flex flex-col gap-2"> <aside class="flex flex-col gap-2">
<h2 class="text-2xl font-medium"> <h2 class="text-2xl font-medium">