57 lines
1.8 KiB
PHP
57 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\InteractionType;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
/**
|
|
* @property int $id
|
|
* @property int $user_id
|
|
* @property int $deal_id
|
|
* @property InteractionType $type
|
|
* @property int $count
|
|
* @property \Illuminate\Support\Carbon|null $created_at
|
|
* @property \Illuminate\Support\Carbon|null $updated_at
|
|
* @property-read \App\Models\Deal|null $deal
|
|
* @property-read \App\Models\Deal|null $user
|
|
*
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Interaction newModelQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Interaction newQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Interaction query()
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Interaction whereCount($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Interaction whereCreatedAt($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Interaction whereDealId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Interaction whereId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Interaction whereType($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Interaction whereUpdatedAt($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Interaction whereUserId($value)
|
|
*
|
|
* @mixin \Eloquent
|
|
*/
|
|
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,
|
|
];
|
|
}
|
|
}
|