*/ protected $allowedFields = [ 'device_code', 'device_name', 'api_key', 'is_active', 'last_seen_at', ]; /** * Attributes that should be cast to specific types * * @var array */ protected $casts = [ 'id' => 'integer', 'is_active' => 'boolean', 'last_seen_at' => 'datetime', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; /** * Check if device is active * * @return bool */ public function isActive(): bool { return (bool) $this->attributes['is_active']; } }