riidme/laravel is a Laravel package for laravel integration for riid.me url shortener service.
It currently has 0 GitHub stars and 3 downloads on Packagist (latest version v1.0.0).
Install it with composer require riidme/laravel.
Discover more Laravel packages by riidme
or browse all Laravel packages to compare alternatives.
Last updated
Laravel integration for the riid.me URL shortener service.
You can install the package via composer:
composer require riidme/laravel
After installing, publish the configuration file:
php artisan vendor:publish --tag="riidme-config"
Add these environment variables to your .env file:
RIIDME_API_URL=https://riid.me
RIIDME_TIMEOUT=5
RIIDME_RETRIES=3
use Riidme\Laravel\Facades\Riidme;
$shortUrl = Riidme::shorten('https://example.com/very/long/url');
echo $shortUrl->getShortUrl(); // https://riid.me/abc123
// or simply
echo $shortUrl; // https://riid.me/abc123
use Riidme\Laravel\RiidmeManager;
class UrlController
{
public function __construct(
private RiidmeManager $riidme
) {}
public function shorten(Request $request)
{
$shortUrl = $this->riidme->shorten($request->url);
return response()->json([
'short_url' => $shortUrl->getShortUrl()
]);
}
}
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The Apache2 License. Please see License File for more information.