Add data user to db old lms
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\OLDLMS;
|
||||
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
@@ -77,4 +78,17 @@ class User extends Authenticatable
|
||||
{
|
||||
return $this->notificationTokens()->pluck('token')->toArray();
|
||||
}
|
||||
|
||||
protected static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
static::creating(function ($user) {
|
||||
$user->sIPAddress = request()->ip();
|
||||
});
|
||||
|
||||
static::updating(function ($user) {
|
||||
$user->sIPAddress = request()->ip();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user