Visits
When features.track_visits is true (default), each successful redirect records
a ShortifyVisit and increments visit_count.
$url->visits; // collection
$url->visit_count; // int
Disable automatic tracking:
'features' => [
'track_visits' => false,
],
You can still call $url->visit() manually.
What is stored
The default DatabaseVisitRecorder stores:
user_id(authenticated visitor, if any)ipuser_agent
Visit insert and visit_count increment run in a database transaction.
Custom visit data
Bind your own VisitRecorder to add geo, referrer, UTM fields, or skip recording
conditionally. See Extending.
Pruning
Permanently delete expired URLs (and optionally old soft-deleted ones):
php artisan shortify:prune
php artisan shortify:prune --hours=168
php artisan shortify:prune --dry-run
Schedule as needed:
Schedule::command('shortify:prune --hours=168')->daily();