dealhub/app/Models/Interaction.php
kusowl af6d629b68 feature(external link redirection count of deal):
add a controller which increments the count for the click of external link of a deal.
2026-01-19 15:52:55 +05:30

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,
];
}
}