Projectslaravel-shortifyUpgrade

Laravel Shortify

Package

URL shortening with visit tracking for Laravel.

Upgrade Guide

Upgrade

First stable release.

Added

  • CodeGenerator, VisitRecorder, and RedirectsShortUrls contracts with container bindings
  • URL ownership via nullable user_id, owner() relation, and ownedBy scope
  • Soft deletes on ShortifyUrl
  • Configurable route middleware and redirect status
  • php artisan shortify:prune (with --hours and --dry-run)
  • Documentation under docs/ for bradietilley.dev
  • LICENSE.md and this changelog

Changed

  • Require PHP ^8.3|^8.4|^8.5 and Laravel ^13.0
  • Visit recording and visit_count updates run in a transaction
  • Code generation stops on the first free code and retries on unique-constraint races
  • CI matrix covers PHP 8.3–8.5 on Laravel 13; Pest 4, Testbench 11, PHPStan 2

Fixed

  • Code generation loop never broke after finding a free code (could leave code null)
  • README / docs typos and the features.track_visits config key documentation

Upgrade notes

  1. Upgrade the host app to PHP 8.3+ and Laravel 13.

  2. Update the package constraint to ^1.0.

  3. Publish and run migrations (includes ownership + soft deletes):

    php artisan vendor:publish --tag="shortify-migrations"
    php artisan migrate
    
  4. Optionally re-publish config for new routing.middleware and routing.redirect_status keys.

  5. If you subclassed Shortify only to customise codes or redirects, prefer binding the new contracts instead.

[0.2.0] - 2024-10-27

Pre-stable release on Laravel 11.