- New SportsMatch model/controller and sports UI components/modal - Move share-modal to a reusable x-share-modal/x-share-button component - Add VideoSharedWithUser notification and share-to-members flow - Device/user-agent tracking on views, downloads, share accesses - ProfileVisit model + migration; subscription source tracking - Email thumbnail support; remove stale TODO files
44 lines
906 B
PHP
44 lines
906 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class ProfileVisit extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
public $timestamps = false;
|
|
|
|
protected $fillable = [
|
|
'profile_user_id',
|
|
'visitor_user_id',
|
|
'device_id',
|
|
'source_video_id',
|
|
'ip_address',
|
|
'country',
|
|
'created_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'created_at' => 'datetime',
|
|
];
|
|
|
|
public function profileUser(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'profile_user_id');
|
|
}
|
|
|
|
public function visitor(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'visitor_user_id');
|
|
}
|
|
|
|
public function sourceVideo(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Video::class, 'source_video_id');
|
|
}
|
|
}
|