Download the PHP package cleaniquecoders/shrinkr without Composer

On this page you can find all versions of the php package cleaniquecoders/shrinkr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package shrinkr

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads


Shrinkr

Shrinkr is a Laravel package for shortening URLs, offering custom slugs, analytics, branded domains, and API integration.

Shrinkr makes it easy to convert long URLs into short, shareable links. With features like custom slugs, click analytics, branded domains, and seamless API support, Shrinkr empowers users to manage URLs effectively.


Features


Installation

Install the package via Composer:

Publish the migration files and migrate:

Publish the config file:

The published configuration file (config/shrinkr.php) will allow you to customize settings.


Configuration

You can configure logging options by modifying the config/shrinkr.php file.

To log to a database, change the logger to:


Usage

Here’s a basic usage example using the Shrinkr facade, actions, and events.


1. Shorten a URL

You can shorten a URL with or without a custom slug and expiry duration.


2. Retrieve the Original URL

Use the resolve() method to retrieve the original URL from a shortened one.

When the URL is accessed, the UrlAccessed event will be dispatched automatically to track the visit.


3. Update an Existing Short URL

You can update an existing short URL with a new custom slug or expiry duration.


4. Event Handling

UrlAccessed Event

The UrlAccessed event is dispatched whenever a shortened URL is accessed. You can listen for this event to log analytics or trigger notifications.

Example: Log URL Access in a Listener

UrlExpired Event

The UrlExpired event is dispatched when a URL has expired, either through a scheduled check or upon access. You can listen to this event to notify the user or perform other actions.

Example: Notify on URL Expiry in a Listener


5. Automatically Expire URLs

If you’ve set an expiry duration, the URL will be marked as expired once that time has passed. You can also run the expiry command manually or schedule it.

Run the Expiry Command Manually:

Schedule the Expiry Command:

In your app/Console/Kernel.php:


6. 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.

Check Health Command

Use the Artisan command to check the health of all URLs in bulk.

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:

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:

This will ensure that all URLs are continuously monitored and marked as expired when necessary.

Redirect Tracking

The redirect feature tracks detailed information such as:

Example database log entry:

url_id ip browser platform referrer created_at
1 192.168.1.1 Chrome Windows google.com 2024-10-18 12:34:56

Testing

Run the tests using:


Changelog

Refer to the CHANGELOG for the latest updates and changes.


Contributing

We welcome contributions! Please see CONTRIBUTING for guidelines.


Security Vulnerabilities

Report security vulnerabilities by reviewing our security policy.


Credits


License

Shrinkr is open-sourced software licensed under the MIT license.


All versions of shrinkr with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
cleaniquecoders/traitify Version ^1.0
illuminate/contracts Version ^10.0||^11.0
jenssegers/agent Version ^2.6
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cleaniquecoders/shrinkr contains the following files

Loading the files please wait ....