Files
alrahma_sunday_school_api/app/Models/LoginActivity.php
T
2026-03-05 12:29:37 -05:00

37 lines
666 B
PHP
Executable File

<?php
namespace App\Models;
use App\Models\BaseModel;
class LoginActivity extends BaseModel
{
protected $table = 'login_activity';
protected $primaryKey = 'id';
protected $fillable = [
'user_id',
'email',
'login_time',
'logout_time',
'ip_address',
'user_agent',
'created_at',
'updated_at',
'semester',
'school_year',
];
public $timestamps = true;
const CREATED_AT = 'created_at';
const UPDATED_AT = 'updated_at';
public function getLastActivities($limit = 4)
{
return $this->orderBy('login_time', 'DESC')->findAll($limit);
}
}
?>