1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 05:14:04 +00:00

more php 7 changes

This commit is contained in:
Samuel Štancl 2021-04-06 22:24:25 +02:00
parent bb40b60d3e
commit 8758c8db3f
2 changed files with 3 additions and 3 deletions

View file

@ -57,7 +57,7 @@ class Tip extends Model
return $this->belongsTo(Author::class, 'author_username', 'username');
}
public function getTweetUrlAttribute(): string|null
public function getTweetUrlAttribute(): string
{
return "https://twitter.com/{$this->author_username}/status/{$this->tweet_id}";
}

View file

@ -12,14 +12,14 @@ class Tweet
public string $id;
public string $text;
public TwitterUser $author;
public string|null $threadId = null;
public ?string $threadId = null;
public array $images = [];
public function __construct(
string $id,
string $text,
TwitterUser $author,
string|null $threadId = null,
?string $threadId = null,
array $images = [],
) {
$this->id = $id;