add projet
This commit is contained in:
Executable
+37
@@ -0,0 +1,37 @@
|
||||
<?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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user