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
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user