Add sports-match type, device tracking, profile visits, and share refactor

- 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
This commit is contained in:
ghassan committed 2026-05-29 01:50:28 +03:00
1 parent 6aae6f86b6
commit 73527f3781
61 files changed
+4014 -636

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
<?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');
}
}
+51
View File
@@ -0,0 +1,51 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class SportsMatch extends Model
{
use HasFactory;
protected $table = 'sports_matches';
protected $fillable = [
'video_id', 'user_id', 'status',
'sport', 'title', 'event_name', 'match_type',
'match_date', 'match_time',
'participant1_name', 'participant2_name', 'referee_name', 'venue_name',
'competition', 'participants', 'media', 'officials',
'venue', 'result', 'segments', 'statistics', 'reviews',
];
protected $casts = [
'match_date' => 'date',
'competition' => 'array',
'participants' => 'array',
'media' => 'array',
'officials' => 'array',
'venue' => 'array',
'result' => 'array',
'segments' => 'array',
'statistics' => 'array',
'reviews' => 'array',
];
public function video(): BelongsTo
{
return $this->belongsTo(Video::class);
}
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function isDraft(): bool
{
return $this->status === 'draft';
}
}
+2 -2
View File
@@ -205,7 +205,7 @@ class User extends Authenticatable implements MustVerifyEmail
'user_subscriptions',
'channel_id',
'subscriber_id'
)->withPivot('created_at');
)->withPivot(['created_at', 'source_video_id']);
}
// Channels this user subscribes to
@@ -216,7 +216,7 @@ class User extends Authenticatable implements MustVerifyEmail
'user_subscriptions',
'subscriber_id',
'channel_id'
)->withPivot('created_at');
)->withPivot(['created_at', 'source_video_id']);
}
public function isSubscribedTo(User $channel): bool