33 lines
581 B
PHP
33 lines
581 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\InteractionType;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class Interaction extends Model
|
|
{
|
|
protected $fillable = [
|
|
'type',
|
|
'user_id',
|
|
];
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Deal::class);
|
|
}
|
|
|
|
public function deal(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Deal::class);
|
|
}
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'type' => InteractionType::class,
|
|
];
|
|
}
|
|
}
|