marbobley/entities-visitor-bundle

Manage visitor connexion information in Doctrine entities

Maintainers

Package info

github.com/marbobley/entities-visitor-bundle

Type:symfony-bundle

pkg:composer/marbobley/entities-visitor-bundle

Statistics

Installs: 13

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

V1.3.0 2026-01-11 10:04 UTC

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;
    }
}