mirror of
https://github.com/archtechx/laravel-tips.git
synced 2025-12-12 05:14:04 +00:00
Support moments in thread tweet_id
This commit is contained in:
parent
798cf7f1b9
commit
8e123a49f4
1 changed files with 5 additions and 1 deletions
|
|
@ -55,9 +55,13 @@ class Thread extends Model
|
|||
|
||||
public function getTweetUrlAttribute(): string
|
||||
{
|
||||
if (is_numeric($this->tweet_id)) {
|
||||
return "https://twitter.com/{$this->author_username}/status/{$this->tweet_id}";
|
||||
}
|
||||
|
||||
return $this->tweet_id;
|
||||
}
|
||||
|
||||
public function getKeyName()
|
||||
{
|
||||
return 'slug';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue