- What is jeffersongoncalves/filament-short-url and what does it do?
- Filament Short URL is a Laravel package that adds a ready-to-use Filament resource for creating and managing shortened links inside your admin panel. You define short codes and destination URLs, and the package provides redirect handling so the short links resolve cleanly when shared. It is aimed at teams already using Filament who want link management without adding separate tooling.
- How do I install filament-short-url in a Laravel app with Filament?
- Install it with Composer using composer require jeffersongoncalves/filament-short-url. Laravel package auto-discovery registers the service provider, so you usually do not need to edit config/app.php. After installing, run any published migrations, clear cached config and views, and confirm the Filament resource appears in your panel navigation. Check the README for the exact publish tags and any panel registration step required by your Filament version.
- Does filament-short-url require Filament, and which Filament version is supported?
- Yes, the package is built for Filament panels: it exposes a Filament resource and the redirect handling that goes with it. Filament major version compatibility should be confirmed in the package composer.json before installing, because Filament v3 and v4 have different resource APIs. Pin a package version that has been tested against your panel's Filament major.
- Which Laravel and PHP versions does filament-short-url support?
- Supported Laravel and PHP versions are defined in the package composer.json, so check that file or the README before adding it to an existing application. In practice, install it in an app whose Laravel and PHP constraints satisfy the package's require block, and run the update in a branch first. If you are on an older Laravel LTS release, verify compatibility rather than assuming it.
- How do I create a short code and map it to a destination URL?
- In the Filament resource, create a new short URL record, enter the short code you want (for example launch) and the full destination URL it should resolve to. Saving the record persists the mapping, and the package's redirect route uses the code to look up and forward visitors. Keep codes unique and avoid characters that could clash with other application routes.
- How does the redirect routing work for short links?
- Redirects are handled by a route registered by the package that matches the short code segment and resolves it to the stored destination URL. Visitors hitting your short link are forwarded to the destination, typically with an HTTP redirect response. Make sure the short-link route prefix does not conflict with existing routes in your application.
- Can I customize the Filament resource, model, or table used by the package?
- Because it is a standard Filament resource, you can extend or override the resource classes, adjust form and table definitions, and customize navigation labels in your own app. If the package ships views or config, publish them so your overrides take precedence and are not lost on updates. Keep customizations in your application code rather than editing vendor files.
- Is there a database migration for short URLs, and can I publish config or views?
- The package stores short codes and destination URLs in a database table created by its migration, which you publish and run as documented in the README. If the package provides configuration or views, publish them with vendor:publish and commit the published files so settings are explicit across environments. Run php artisan migrate in each environment as part of your deployment process.
- How should I test that short links redirect correctly?
- Create a short URL record in a staging environment and request the generated short link, asserting that the response redirects to the expected destination. Cover edge cases such as unknown codes, duplicate codes, and destination URLs that include query strings. Automating this as a feature test protects you against regressions when the resource or routing changes.
- What are alternatives to filament-short-url, and is it production-ready?
- Alternatives include dedicated link-shortening services, generic Laravel redirect packages, or writing a small controller and model yourself if your requirements are minimal. filament-short-url is a good fit when you already run Filament and want link management in the same admin panel. Review the repository's release history and issue activity to judge maintenance cadence before committing to it in production.