33 lines
675 B
PHP
33 lines
675 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Concerns\HasUlids;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Relations\Pivot;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class Participant extends Pivot
|
|
{
|
|
use HasFactory, HasUlids;
|
|
|
|
protected $table = 'participants';
|
|
|
|
public $incrementing = false;
|
|
|
|
protected $fillable = [
|
|
'conversation_id',
|
|
'user_id',
|
|
];
|
|
|
|
public function conversation(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Conversation::class);
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|