marbobley / entities-visitor-bundle
Manage visitor connexion information in Doctrine entities
Package info
github.com/marbobley/entities-visitor-bundle
Type:symfony-bundle
pkg:composer/marbobley/entities-visitor-bundle
V1.3.0
2026-01-11 10:04 UTC
Requires
- doctrine/orm: ^3.6
- psr/log: ^1.1 || ^2.0 || ^3.0
- symfony/http-foundation: ^6.4 || ^7.0
- symfony/http-kernel: ^6.4 || ^7.0
Requires (Dev)
- phpunit/phpunit: ^12.5
This package is auto-updated.
Last update: 2026-03-11 10:22:26 UTC
README
Package to manage visitors with DB persistence in Symfony
Installation
composer require marbobley/entities-visitor-bundle
Usage
Create an entity Visitor and extends it from VisitorInformation
- Create the migration script: symfony console make:migration
- Migrate the script : symfony console doctrine:migrations:migrate
When someone visits your site, the event listener will create an entry into the VisitorInformation table
Features
Currently, the bundle only supports Doctrine ORM.
Column saved :
- client ip
- user Agent
- visited at
- method
- route
- control
- path
Setting :
Create a config file :
- In config/packages/entities_visitor_bundle.yaml
entities_visitor_bundle:
enable: false #To activate or desactive the check of visitor
Example
<?php
namespace App\Entity;
use App\Repository\VisitorInformationRepository;
use Doctrine\ORM\Mapping as ORM;
use Marbobley\EntitiesVisitorBundle\Model\VisitorInformation as VisitorInformationModel;
#[ORM\Entity(repositoryClass: VisitorInformationRepository::class)]
class VisitorInformation extends VisitorInformationModel
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
public function getId(): ?int
{
return $this->id;
}
}