*/ use HasFactory; /** * Indicates if the model should be timestamped. */ public $timestamps = false; /** * The attributes that are mass assignable. */ protected $fillable = [ 'ip_address', 'user_agent', 'login_at', 'login_successful', 'logout_at', 'cleared_by_user', 'guard', 'login_method', ]; /** * The attributes that should be cast. */ protected $casts = [ 'cleared_by_user' => 'boolean', 'login_successful' => 'boolean', 'login_at' => 'datetime', 'logout_at' => 'datetime', ]; /** * MorphTo relation to get the associated authenticatable user * * @return MorphTo<\Illuminate\Database\Eloquent\Model, AuthLog> */ public function authenticatable() { return $this->morphTo(); } /** * Compare 2 Authentications */ public function equals(self $other) : bool { return $this->ip_address === $other->ip_address && $this->user_agent === $other->user_agent && $this->login_at == $other->login_at && $this->login_successful == $other->login_successful && $this->logout_at == $other->logout_at && $this->cleared_by_user == $other->cleared_by_user && $this->guard == $other->guard && $this->login_method == $other->login_method; } }