ilya_cig / track-session
Track Session
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/ilya_cig/track-session
Requires
- php: ^8.2
Requires (Dev)
- nunomaduro/phpinsights: ^2.11
- orchestra/testbench: ^9.2
This package is auto-updated.
Last update: 2026-03-01 00:58:09 UTC
README
This is a simple Laravel package to track a user's session anywhere in the code.
Installation
Install using composer:
composer require ilya_cig/track-session:dev-master
Run migrations:
php artisan migrate --path=/vendor/ilya_cig/track-session/database/migrations/2024_07_24_123500_create_track_session_table.php
(optional) Add the service provider in config/app.php:
CIG\TrackSession\Providers\TrackSessionServiceProvider::class,
(optional) And add the Agent alias to config/app.php:
'TrackSession' => CIG\TrackSession\Facades\TrackSessionFacade::class,
Basic Usage
If you want track session just use:
use TrackSession; TrackSession::track();
OR
use CIG\TrackSession\Facades\TrackSessionFacade; TrackSessionFacade::track();
OR
use CIG\TrackSession\Services\TrackSessionServices; $trackSession = new TrackSessionServices(); $trackSession->track();
OR
use Illuminate\Support\Facades\App; $trackSession = App::make('track.session'); $trackSession->track();
OR
use CIG\TrackSession\Jobs\TrackSession; TrackSession::dispatch();
License
TrackSession is licensed under The MIT License (MIT).
Testing
vendor/bin/testbench migrate
./vendor/bin/phpunit --filter test_save_in_table tests/Feature/TrackSession.php