dealhub/app/Models/Interaction.php
kusowl 16c9ff3cee feat: implement user interaction system with like functionality
- Updated interaction models and relations for handling of user-deal interactions.
- Added frontend interactivity with `interaction.js` for toggling like buttons.
2026-01-15 19:09:24 +05:30

28 lines
510 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
{
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,
];
}
}