Files
animexe/app/Models/UserActivityLog.php
2026-07-14 00:01:48 +03:00

46 lines
1.5 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class UserActivityLog extends Model
{
public $timestamps = false;
protected $fillable = [
'user_id', 'session_id', 'action', 'subject_type', 'subject_id',
'ip', 'country', 'city', 'device', 'browser', 'user_agent', 'is_bot', 'meta',
];
protected $casts = ['meta' => 'array', 'is_bot' => 'boolean'];
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
// Human-readable action labels
public static array $actionLabels = [
'login' => 'Giriş',
'logout' => 'Çıkış',
'register' => 'Kayıt',
'pageview' => 'Sayfa Görüntüleme',
'anime_view' => 'Anime Görüntüleme',
'episode_watch' => 'Bölüm İzleme',
'comment_create' => 'Yorum',
'watchlist_add' => 'Listeye Ekle',
'watchlist_remove'=> 'Listeden Çıkar',
'rating' => 'Puan Verdi',
'follow' => 'Takip',
'search' => 'Arama',
'download' => 'İndirme',
'capsule_create' => 'Kapsül Oluşturdu',
'tribunal_vote' => 'Mahkeme Oyu',
'prediction_vote' => 'Tahmin Oyu',
'nico_comment' => 'Nico Yorum',
'password_change' => 'Şifre Değiştirdi',
'profile_update' => 'Profil Güncelledi',
];
}