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:
parent
bb40b60d3e
commit
8758c8db3f
2 changed files with 3 additions and 3 deletions
|
|
@ -57,7 +57,7 @@ class Tip extends Model
|
||||||
return $this->belongsTo(Author::class, 'author_username', 'username');
|
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}";
|
return "https://twitter.com/{$this->author_username}/status/{$this->tweet_id}";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,14 @@ class Tweet
|
||||||
public string $id;
|
public string $id;
|
||||||
public string $text;
|
public string $text;
|
||||||
public TwitterUser $author;
|
public TwitterUser $author;
|
||||||
public string|null $threadId = null;
|
public ?string $threadId = null;
|
||||||
public array $images = [];
|
public array $images = [];
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
string $id,
|
string $id,
|
||||||
string $text,
|
string $text,
|
||||||
TwitterUser $author,
|
TwitterUser $author,
|
||||||
string|null $threadId = null,
|
?string $threadId = null,
|
||||||
array $images = [],
|
array $images = [],
|
||||||
) {
|
) {
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue