fix first production issues
API CI/CD / Validate (composer + pint) (push) Failing after 1m11s
API CI/CD / Test (PHPUnit) (push) Failing after 2m30s
API CI/CD / Build frontend assets (push) Successful in 1m14s
API CI/CD / Security audit (push) Failing after 48s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped

This commit is contained in:
root
2026-07-10 03:43:50 -04:00
parent 02ba2fe6b6
commit e9c10ae376
11 changed files with 687 additions and 564 deletions
+10 -7
View File
@@ -6,10 +6,17 @@ class LoginActivity extends BaseModel
{
protected $table = 'login_activity';
// ✅ legacy: useTimestamps = true (created_at/updated_at)
public $timestamps = true;
protected $fillable = ['user_id', 'email', 'login_time', 'logout_time', 'ip_address', 'user_agent', 'created_at', 'updated_at', 'semester', 'school_year'];
protected $fillable = [
'user_id',
'email',
'login_time',
'logout_time',
'ip_address',
'user_agent',
'school_year',
];
protected $casts = [
'user_id' => 'integer',
@@ -17,15 +24,11 @@ class LoginActivity extends BaseModel
'logout_time' => 'datetime',
];
/* Optional relationship */
public function user()
{
return $this->belongsTo(User::class, 'user_id');
}
/**
* Equivalent of legacy getLastActivities()
*/
public static function getLastActivities(int $limit = 4)
{
return static::query()
@@ -33,4 +36,4 @@ class LoginActivity extends BaseModel
->limit(max(1, $limit))
->get();
}
}
}