Releases: cleaniquecoders/shrinkr
v1.0.3
Shrinkr v1.0.3 Release Notes
Full Changelog: v1.0.2...v1.0.3
Enhancements
-
Allow to set middleware to the Shrinkr route. By default the middleware used is
['throttle:60,1']
. You can any middleware you think is suitable such as['auth','verified','throttle:60,1']
. -
Allow to set custom domain for the Shrnkr by setting the
domain
key inconfig/shrinkr.php
. -
Update code base to comply with PHPStan Level 9 (still few pending for fixes - contribution much appreciated).
Upgrade Notes
- Update your
shrinkr.php
configuration file to customize rate limiting and enable protected URLs if needed.
v1.0.2
Monitor URL Health
The Link Health Monitoring feature allows you to check if URLs are reachable and mark them as active or expired.
Check Health Action
Use the CheckUrlHealthAction
to manually check the health of a specific URL.
use CleaniqueCoders\Shrinkr\Actions\CheckUrlHealthAction;
use CleaniqueCoders\Shrinkr\Models\Url;
$url = Url::find(1); // Retrieve URL instance
$action = new CheckUrlHealthAction();
$isHealthy = $action->execute($url);
if ($isHealthy) {
echo "URL is active.";
} else {
echo "URL is expired.";
}
Check Health Command
Use the Artisan command to check the health of all URLs in bulk.
php artisan shrinkr:check-health
This command will:
- Check the status of all URLs.
- Mark expired URLs and dispatch the
UrlExpired
event. - Provide real-time output on the status of each URL.
Example output:
URL abc123 is now marked as active.
URL xyz456 is now marked as expired.
URL health check completed.
Schedule the Health Check Command
You can automatically run the health check at regular intervals using Laravel’s scheduler.
In your app/Console/Kernel.php
:
protected function schedule(Schedule $schedule)
{
$schedule->command('shrinkr:check-health')->hourly();
}
This will ensure that all URLs are continuously monitored and marked as expired when necessary.
Full Changelog: v1.0.1...v1.0.2
Expiry & Event
- Shorten URLs with optional custom slugs and expiry durations.
- Retrieve original URLs using the short code with
resolve()
. - Update URLs: Modify slugs and expiry times as needed.
- UrlAccessed Event: Track when a URL is accessed.
- UrlExpired Event: Trigger actions when a URL expires.
- Expiry Command:
- Manually run with:
php artisan shrinkr:check-expiry
- Schedule it to run hourly or daily.
- Manually run with:
- Exception Handling: Custom exception for duplicate slugs (
SlugAlreadyExistsException
).
Manage URLs efficiently with automatic expiry, logging, and event-based notifications! 🎉
Full Changelog: v1.0.0...v1.0.1
v1.0.0
Full Changelog: https://github.com/cleaniquecoders/shrinkr/commits/v1.0.0