parsadanashvili/laravel-cuttly

Cutt.ly Package For Shorten Your Links

v1.1.0 2022-04-06 18:16 UTC

This package is auto-updated.

Last update: 2024-09-06 23:10:58 UTC


README

This package allows you to process shorten links with Cutt.ly from your Laravel application.

Laravel Cutt.ly Integration

Installation

composer require parsadanashvili/laravel-cuttly

For Laravel <= 5.4

If you're using Laravel 5.4 or lower, you have to manually add a service provider in your config/app.php file. Open config/app.php and add CuttlyServiceProvider to the providers array.

'providers' => [
    # Other providers
    Parsadanashvili\LaravelCuttly\CuttlyServiceProvider::class,
],

Publish migrations and config by running:

php artisan vendor:publish --provider="Parsadanashvili\LaravelCuttly\CuttlyServiceProvider"

API Keys

Place api key to .env file:

CUTTLY_API_KEY=CuttlyApiKey

Shorten Url

To shorten url you should use Shorten Url function

Parameters:

  • url - string, required

Return: https://cutt.ly/mFtHxpP

use Parsadanashvili\LaravelCuttly\Requests\ShortenUrl;

return ShortenUrl::request('https://google.com')
    ->name('Name') //optional
    ->useDomain() //optional
    ->process();

Authors