finished laravel migration
This commit is contained in:
45
app/Models/Post.php
Normal file
45
app/Models/Post.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $thread_id
|
||||
* @property int|null $user_id
|
||||
* @property string $body
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @property-read \App\Models\Thread $thread
|
||||
* @property-read \App\Models\User|null $user
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Post newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Post newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Post query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Post whereBody($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Post whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Post whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Post whereThreadId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Post whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Post whereUserId($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class Post extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'thread_id',
|
||||
'user_id',
|
||||
'body',
|
||||
];
|
||||
|
||||
public function thread(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Thread::class);
|
||||
}
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user