Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Vatsim Url Shortener Laravel Package

nfarrington/vatsim-url-shortener

A Laravel/PHP package for shortening URLs, tailored to VATSIM projects and workflows. Easily create compact, shareable links for flight plans, event pages, pilot bookings, briefing resources, and more, backed by a clean API, custom slugs, configurable drivers, and optional click analytics.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install with composer require nfarrington/vatsim-url-shortener, then publish and run its assets: php artisan vendor:publish --tag=url-shortener-config (and the migrations tag), followed by php artisan migrate. Confirm the actual tags with php artisan vendor:publish --provider="NFarrington\UrlShortener\...ServiceProvider" if the shorthand tag isn't registered.
  • Look first at the published config file and the package's routes/ file. The config governs the allowed URL prefixes (the core safety control) and the slug/code generation settings; the routes file tells you which paths are public (the redirect endpoint) versus protected (creation/management, 2FA-gated).
  • First use case: shorten a registration or event link for a VATSIM event so it can be pasted into Discord/forum posts. Create the link through the package's model/service or its management UI, verify the redirect resolves, then confirm the target host is inside your configured prefix allow-list.

Implementation Patterns

  • Programmatic creation over manual entry. Wrap link creation in your own action/service class so slugs, ownership, and expiry are set consistently. Keep the package's model as the persistence layer and put your business rules (campaign tagging, per-user quotas) one layer above it.
  • Prefix allow-listing as a policy layer. Treat the prefix/URL validation config as your anti-phishing boundary. Enumerate the exact hosts you intend to shorten (e.g. your chapter site, the VATSIM event pages) rather than broad wildcards, and review that list whenever a new campaign starts.
  • Blade rendering of link tables. Anywhere you list links, render slug and target with {{ }} escaping and only allow {!! !!} for values you generated server-side. The v1.33 XSS fix is a reminder that these fields are attacker-influenced input, not trusted config.
  • 2FA-gated admin surface. Keep all create/edit/delete routes behind the package's hardened 2FA middleware plus your own authorization gate. If you have a custom admin panel that calls the package's services, make sure it sits behind the same middleware stack rather than reusing the public redirect route group.
  • Redirect handling. Let the package own the redirect route; don't reimplement it in your app's web.php. If you need custom behaviour (UTM appending, hit counting, 404 page), use the package's events/extension points or a thin controller that delegates, so future patches to the redirect logic aren't bypassed.
  • Testing. Use RefreshDatabase and feature-test the redirect endpoint plus a rejected-prefix case. That rejected-prefix test is your regression guard the next time URL validation changes.

Gotchas and Tips

  • v1.33 is a security release — upgrade now. It fixes stored XSS, hardens two-factor auth, and tightens URL/prefix validation. It's a patch bump, so no API breaks are advertised, but the stricter validation is a behavioural change: links that were accepted under v1.32 may now be rejected.
  • Audit existing rows before/after upgrading. Query stored targets that don't match your configured prefixes; decide whether to delete, re-point, or widen the allow-list deliberately. Otherwise the management UI may surface validation errors on legacy records.
  • Prefix matching is string matching. Make sure the allow-list entries are anchored (scheme + host + path boundary), so https://vatsim.net.evil.example can't satisfy a https://vatsim.net prefix. Verify the package's exact matching semantics rather than assuming.
  • 2FA hardening can invalidate sessions/enrolments. After deploying, expect some admins to be prompted to re-authenticate or re-enrol. Communicate this, clear the config cache (php artisan config:clear / config:cache in deploy), and check the release/PR for any migration or config additions.
  • Re-publish views and config after upgrading if you've published them — your local copies won't receive the XSS fix. Diff your published overrides against the package's originals.
  • Stored XSS surfaces are broader than the link list. Anything that echoes a submitted URL (flash messages, logs rendered in a dashboard, export CSVs opened in a browser) needs the same escaping discipline.
  • Debugging: start with the published config and php artisan route:list --path=<shortener-prefix>; a 404 on a valid slug is usually a route-cache or wrong-prefix issue, not a data problem.
  • Extension points: prefer publishing config and overriding the model's fillable/validation rules over forking. If you must fork, track the package's upstream security patches closely — this release shows it's actively maintained.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager