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

livewire thread

This commit is contained in:
Samuel Štancl 2021-04-09 18:47:19 +02:00
parent a60370fbc9
commit 57ab16675e
18 changed files with 244 additions and 25 deletions

View file

@ -15,6 +15,10 @@ class Thread extends Model
public $timestamps = false;
public $casts = [
'links' => 'array',
];
public static function schema(Blueprint $table)
{
$table->string('slug')->unique();
@ -22,6 +26,7 @@ class Thread extends Model
$table->string('tweet_id')->nullable();
$table->foreignId('author_username')->constrained('authors', 'username');
$table->text('content');
$table->json('links')->default('{}');
$table->timestamp('created_at');
}