Looking to hire Laravel developers? Try LaraJobs

laravel-cuttly maintained by parsadanashvili

Description
Cutt.ly Package For Shorten Your Links
Last update
2022/04/06 20:22 (dev-main)
License
Links
Downloads
83

Comments
comments powered by Disqus

Laravel Cutt.ly Integration Package

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