Download the PHP package tourze/device-bundle without Composer
On this page you can find all versions of the php package tourze/device-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package device-bundle
DeviceBundle
中文
A Symfony bundle for managing user devices and login logs with comprehensive tracking capabilities.
Table of Contents
- Features
- Requirements
- Installation
- Configuration
- Quick Start
- Usage
- Advanced Usage
- Database Schema
- Security
- Contributing
- License
Features
- Device Management: Register and manage user devices with unique codes
- User-Device Association: Many-to-many relationship between users and devices
- Login Tracking: Detailed login logs with IP, platform, device info
- Admin Interface: Built-in EasyAdmin controllers for device management
- Data Fixtures: Pre-configured test data for development
- Automatic Cleanup: Scheduled cleanup of old login logs
- Platform Detection: Support for various platforms (iOS, Android, etc.)
Requirements
- PHP 8.1 or higher
- Symfony 7.3 or higher
- Doctrine ORM 3.0+
- EasyAdmin Bundle 4.x
Installation
Note: If you're working in this monorepo environment, the bundle is automatically available. For Symfony Flex projects, the bundle will be automatically registered in config/bundles.php.
Configuration
The bundle provides optional configuration for customizing behavior:
Quick Start
1. Register a Device
2. Track Login Events
Usage
Device Service
The DeviceService provides methods for device management:
Login Log Service
Track user login activities:
Device Status Management
Monitor and update device online status:
Advanced Usage
Custom Device Types
You can extend the device type system:
Hardware Information Tracking
Update device hardware details:
Custom Data Fixtures
Create your own device fixtures:
Admin Interface Customization
The bundle provides admin controllers that can be customized:
Data Fixtures
Load test data for development:
Database Schema
Device Table (ims_device)
id- Snowflake IDcode- Unique device identifiermodel- Device model namename- Device display namevalid- Device validity statusreg_ip- Registration IP addresscreate_time/update_time- Timestamps
Login Log Table (device_login_log)
id- Auto-increment IDuser_id- Associated userlogin_ip- Login IP addresslogin_platform- Platform enumlogin_imei- Device IMEIlogin_channel- Login channelsystem_version- OS versionversion- App versionip_city- IP location cityip_location- Full IP locationdevice_model- Device modelnet_type- Network typecreate_time- Log timestamp
Security
Data Privacy
- IP Address Logging: Login IPs are stored for security tracking. Consider GDPR compliance for EU users.
- Device Fingerprinting: Hardware fingerprints are stored as TEXT fields with length validation.
- Automatic Cleanup: Old login logs are automatically cleaned up according to configured retention periods.
Input Validation
- All entity properties include proper validation constraints
- Device codes must be unique and are validated for length
- IP addresses are validated using Symfony's IP constraint
- Device models use regex validation to prevent malicious input
Access Control
- Admin controllers should be protected by proper authentication
- Consider implementing role-based access for device management
- Use CSRF protection on admin forms
Contributing
Please see CONTRIBUTING.md for details.
License
The MIT License (MIT). Please see License File for more information.
All versions of device-bundle with dependencies
doctrine/data-fixtures Version ^2.0
doctrine/dbal Version ^4.0
doctrine/doctrine-bundle Version ^2.13
doctrine/doctrine-fixtures-bundle Version ^4.0
doctrine/orm Version ^3.0
doctrine/persistence Version ^4.1
easycorp/easyadmin-bundle Version ^4
knplabs/knp-menu Version ^3.7
nesbot/carbon Version ^2.72 || ^3
symfony/config Version ^7.3
symfony/dependency-injection Version ^7.3
symfony/doctrine-bridge Version ^7.3
symfony/form Version ^7.3
symfony/framework-bundle Version ^7.3
symfony/http-foundation Version ^7.3
symfony/http-kernel Version ^7.3
symfony/property-access Version ^7.3
symfony/routing Version ^7.3
symfony/security-core Version ^7.3
symfony/yaml Version ^7.3
tourze/bundle-dependency Version 1.*
tourze/doctrine-indexed-bundle Version 1.0.*
tourze/doctrine-snowflake-bundle Version 1.1.*
tourze/doctrine-timestamp-bundle Version 1.1.*
tourze/doctrine-track-bundle Version 1.1.*
tourze/easy-admin-menu-bundle Version 1.0.*
tourze/enum-extra Version 1.0.*
tourze/operation-system-enum Version 1.0.*
tourze/symfony-dependency-service-loader Version 1.0.*
tourze/symfony-routing-auto-loader-bundle Version 1.0.*
tourze/symfony-schedule-entity-clean-bundle Version 1.1.*