Initialer Laravel Commit für BetiX
This commit is contained in:
36
app/Models/GuildMessage.php
Normal file
36
app/Models/GuildMessage.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class GuildMessage extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'guild_id',
|
||||
'user_id',
|
||||
'type',
|
||||
'message',
|
||||
'reply_to_id',
|
||||
'is_deleted',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'is_deleted' => 'boolean',
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function guild()
|
||||
{
|
||||
return $this->belongsTo(Guild::class);
|
||||
}
|
||||
|
||||
public function replyTo()
|
||||
{
|
||||
return $this->belongsTo(GuildMessage::class, 'reply_to_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user