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
Laravel Yourls Plugin

Laravel Yourls Plugin Laravel Package

phpsa/laravel-yourls-plugin

phpsa/laravel-yourls-plugin provides seamless YOURLS URL shortening integration for Laravel. Generate and manage short links through familiar Laravel APIs and configuration, making it easy to add branded, trackable short URLs to your projects.

View on GitHub
Deep Wiki
Context7

Plugin which integrates Laravel with Yourls (Your Own URL Shortener).

Frequently asked questions about Laravel Yourls Plugin
How do I install phpsa/laravel-yourls-plugin in a Laravel app?
Install it with Composer using composer require phpsa/laravel-yourls-plugin, then let Laravel package auto-discovery register the service provider. Publish the package configuration with php artisan vendor:publish and set your YOURLS API endpoint and credentials as environment variables. Before installing, check the composer.json constraints to confirm your Laravel and PHP versions are supported.
Which Laravel and PHP versions does this YOURLS plugin support?
The package is a thin integration layer for a self-hosted YOURLS instance, but its last release was December 2023, so Laravel 11 and 12 compatibility is unconfirmed. Review the illuminate/support and PHP constraints in composer.json and run a short spike on your target Laravel version. Pin the package and test in staging before relying on it.
How do I configure the YOURLS endpoint and credentials in Laravel?
After publishing the config file, set the full URL to your YOURLS yourls-api.php endpoint plus either a signature token or username and password in your .env file. Keep these secrets out of version control and validate them at application boot so misconfiguration fails fast. The package reads configuration through Laravel's config repository, so you can override values per environment.
Does it support YOURLS signature token auth as well as username and password?
YOURLS itself supports both signature token and username/password authentication, but this wrapper's coverage of each mode is a key evaluation question. Inspect the package source and README to confirm which mode it sends by default and whether both are configurable. Test the chosen mode against a pinned YOURLS version in staging before rollout.
Can I create custom keywords and titles for short URLs?
YOURLS supports custom keywords and titles through its API actions, and the plugin is expected to pass these parameters through to the client. Check the package source or README for the exact method signatures that accept a keyword or title. If the wrapper does not expose them, you can extend the client or call yourls-api.php directly behind your own adapter.
Are the YOURLS API calls synchronous, and can I configure timeouts?
The package makes synchronous HTTP calls to your YOURLS endpoint, so shortening runs inside the request or job that invokes it. Configure short connection and response timeouts, and wrap calls so a YOURLS outage does not break your main workflow. The evaluation notes no built-in retry or backoff, so add retry logic and graceful degradation in your own adapter.
Should I use the facade or dependency injection?
The package offers a familiar Laravel facade or injectable client, but avoid calling the facade directly from domain code. Wrap it behind a project-owned UrlShortener interface and keep YOURLS-specific configuration and response mapping inside that adapter. This lets you swap in a direct HTTP client or another provider later without broad refactoring.
How do I test URL shortening without a real YOURLS server?
There is no confirmed test coverage against a live YOURLS instance, so mock the HTTP layer with Laravel's HTTP fake or Guzzle mock handler for unit tests. Run an integration test against a disposable, version-pinned YOURLS container in CI or staging. Assert on error handling paths such as timeouts, invalid credentials, and malformed JSON responses.
Is phpsa/laravel-yourls-plugin maintained and safe for production?
It has a small code surface and an MIT license, but roughly 17 GitHub stars, a single-maintainer signal, and a last release in December 2023 mean limited community validation. Run a dependency and security audit, review open issues and the maintainer's responsiveness, and adopt conditionally for low-risk internal shortening. Avoid exposing it directly to end-user URL submission without phishing and SSRF controls.
What are the alternatives if I need high-volume or multi-tenant URL shortening?
For high volume, per-tenant credentials, or customer-facing redirects, treat YOURLS as a separate service dependency and use a small direct HTTP client against yourls-api.php behind your own interface. Managed link-shortening providers are another option; keep short domains and keywords portable if you migrate. This package fits best as an internal utility adapter rather than a core redirect component.
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