summaryrefslogtreecommitdiff
path: root/src/Http/Models
diff options
context:
space:
mode:
Diffstat (limited to 'src/Http/Models')
-rw-r--r--src/Http/Models/AccessLog.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/Http/Models/AccessLog.php b/src/Http/Models/AccessLog.php
new file mode 100644
index 0000000..cdfef4b
--- /dev/null
+++ b/src/Http/Models/AccessLog.php
@@ -0,0 +1,33 @@
+<?php
+
+namespace Lightscale\LaralightAccessLog\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class AccessLog extends Model
+{
+ const UPDATED_AT = null;
+
+ protected array $guarded = [
+ 'user_id'
+ ];
+
+ public function __construct(array $attributes = [])
+ {
+ $this->setTable(config('access_log.table_name'));
+
+ parent::__construct($attributes);
+ }
+
+ protected function cast(): array
+ {
+ return [
+ 'properties' => 'collection',
+ ]
+ }
+
+ public function user(): BelongsTo
+ {
+ return $this->belongsTo(config('access_log.user_model'));
+ }
+}