mirror of
https://github.com/archtechx/laravel-tips.git
synced 2025-12-12 05:14:04 +00:00
Fix content, add command, update readme
This commit is contained in:
parent
3c3a5fcfd9
commit
69d86147d7
12 changed files with 70 additions and 35 deletions
|
|
@ -32,7 +32,7 @@ class Thread extends Model
|
|||
$table->string('slug')->unique();
|
||||
$table->string('title');
|
||||
$table->string('tweet_id')->nullable();
|
||||
$table->foreignId('author_username')->constrained('authors', 'username');
|
||||
$table->foreignId('author_username')->nullable()->constrained('authors', 'username');
|
||||
$table->text('content');
|
||||
$table->json('links')->default('{}');
|
||||
$table->timestamp('created_at');
|
||||
|
|
@ -58,7 +58,7 @@ class Thread extends Model
|
|||
if (is_numeric($this->tweet_id)) {
|
||||
return "https://twitter.com/{$this->author_username}/status/{$this->tweet_id}";
|
||||
}
|
||||
|
||||
|
||||
return $this->tweet_id;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue