Skip to content

Releases: cleaniquecoders/shrinkr

v1.0.3

14 Nov 15:14
Compare
Choose a tag to compare

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 in config/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

20 Oct 13:29
Compare
Choose a tag to compare

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:

  1. Check the status of all URLs.
  2. Mark expired URLs and dispatch the UrlExpired event.
  3. 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

20 Oct 13:05
Compare
Choose a tag to compare
  • 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.
  • 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

20 Oct 11:55
Compare
Choose a tag to compare