media365 / squeezer
url shorten package using Laravel
Installs: 25 819
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 2
Open Issues: 0
Requires
- php: ^7.1|^8.0
- guzzlehttp/guzzle: ^6.2|^7.0.1
- guzzlehttp/psr7: ^1.4
- psr/http-message: ^1.0
This package is auto-updated.
Last update: 2024-06-06 16:28:09 UTC
README
URL shortening or squeezing package in Laravel.
Installation
You can easily install this package using Composer, by running the following command:
composer require media365/squeezer
Requirements
This package has the following requirements:
- PHP 7.1 or higher
- Laravel 5.1 or higher
Laravel 5.5+
If you use Laravel 5.5 or higher, that's it. You can now use the package, continue to the usage section.
Laravel 5.1-5.4
If you're using an older version of Laravel, register the package's service provider to your application. You can do
this by adding the following line to your config/app.php
file:
'providers' => [ ... Media365\Squeezer\SqueezerServiceProvider::class, ... ],
Usage
$shortener = app('url.shortener');
Once you have an instance of the shortener, you can shorten your URLs:
// This will return your shortened URL as a string $shortener->shorten('https://github.com');
You can provide driver to shorten url
// This will return your shortened URL as a string with provided driver $shortener->driver('is_gd')->shorten('https://github.com')