PHPackages                             tourze/device-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. tourze/device-bundle

ActiveSymfony-bundle[Authentication &amp; Authorization](/categories/authentication)

tourze/device-bundle
====================

设备管理和登录日志追踪的 Symfony Bundle

1.0.1(6mo ago)0215MITPHPCI passing

Since Apr 17Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/tourze/device-bundle)[ Packagist](https://packagist.org/packages/tourze/device-bundle)[ RSS](/packages/tourze-device-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (41)Versions (10)Used By (0)

DeviceBundle
============

[](#devicebundle)

[English](README.md) | [中文](README.zh-CN.md)

[![PHP Version Require](https://camo.githubusercontent.com/299a74a4b293c08c7dc8aacaf0d8784549c34fc36e2465ded15cb89883419b82/68747470733a2f2f706f7365722e707567782e6f72672f746f75727a652f6465766963652d62756e646c652f726571756972652f706870)](https://packagist.org/packages/tourze/device-bundle)[![Latest Version](https://camo.githubusercontent.com/ec5daa366328ce64d84ca40104039416201c0fc99db7c425f3c13577079af54d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f75727a652f6465766963652d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/device-bundle)

[![License](https://camo.githubusercontent.com/f3bd4e00e0f8d413ef98d180ebe28fea910c091fabf219cee1dc404c69d00267/68747470733a2f2f706f7365722e707567782e6f72672f746f75727a652f6465766963652d62756e646c652f6c6963656e7365)](https://packagist.org/packages/tourze/device-bundle)[![Total Downloads](https://camo.githubusercontent.com/013aad7d4ab199432a8d0a62ab55ea6c80ccbed28233234697c4b11f8716fe1e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f75727a652f6465766963652d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/device-bundle)[![Build Status](https://github.com/tourze/device-bundle/workflows/CI/badge.svg)](https://github.com/tourze/device-bundle/actions)[![Code Coverage](https://camo.githubusercontent.com/2f3543add6765ceb85fc4b6f466920d501837c57cd9c25cac26f455aa38e8f29/68747470733a2f2f636f6465636f762e696f2f67682f746f75727a652f6465766963652d62756e646c652f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/tourze/device-bundle)

A Symfony bundle for managing user devices and login logs with comprehensive tracking capabilities.

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
- [Quick Start](#quick-start)
- [Usage](#usage)
- [Advanced Usage](#advanced-usage)
- [Database Schema](#database-schema)
- [Security](#security)
- [Contributing](#contributing)
- [License](#license)

Features
--------

[](#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
------------

[](#requirements)

- PHP 8.1 or higher
- Symfony 7.3 or higher
- Doctrine ORM 3.0+
- EasyAdmin Bundle 4.x

Installation
------------

[](#installation)

```
composer require tourze/device-bundle
```

**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
-------------

[](#configuration)

The bundle provides optional configuration for customizing behavior:

```
# config/packages/device.yaml
device:
    # Optional: Configure login log cleanup
    cleanup:
        enabled: true
        retention_days: 30

    # Optional: Admin interface settings
    admin:
        enabled: true
        menu_section: "Device Management"
```

Quick Start
-----------

[](#quick-start)

### 1. Register a Device

[](#1-register-a-device)

```
