Refactor IP History

This commit is contained in:
xiaomlove
2025-10-14 14:54:44 +07:00
parent 0f172a94be
commit ba8715a3f9
34 changed files with 494 additions and 131 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Nexus\Database\NexusDB;
@@ -16,6 +17,13 @@ class NexusModel extends Model
protected $connection = NexusDB::ELOQUENT_CONNECTION_NAME;
protected function usernameForAdmin(): Attribute
{
return Attribute::make(
get: fn (mixed $value, array $attributes) => username_for_admin($attributes['uid'] ?? $attributes['userid'] ?? $attributes['user_id'])
);
}
/**
*
* @param \DateTimeInterface $date