Download the PHP package toneflix-code/cuttly-laravel without Composer

On this page you can find all versions of the php package toneflix-code/cuttly-laravel. 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 cuttly-laravel

Cutt.ly Laravel

Run Tests Latest Stable Version Total Downloads License PHP Version Require codecov

Cutt.ly is a Link Management Platform with all features you need in one place. Shorten your links, track clicks, and boost your brand with our all-in-one URL Shortener. Create custom short links, generate QR codes, build link-in-bio pages, and gather feedback with surveys. Start optimizing your URLs today and see the impact!y, Cuttly PHP aims to work around the Cutt.ly API by providing a simple PHP wrapper arround it, on the other hand, this package has been curated to make installation and getting started a little easier for Laravel Artisans.

Please refere to Cutt.ly API Documentation for detailed api use description as this package tries to mirror the API in the best possible way.

Requirements

Installation

You can install the package via composer:

Upgrading

If you're coming from verson 1.x, you may not be able to upgrade to 2.x as version is a complete rewrite of the package, with almost full support of entire cutt.ly API, version 1.x has been moved to the v1.x.x branch and will continue to recieve security patches and features till the end of 2025.

Package Discovery

Laravel automatically discovers and publishes service providers but optionally after you have installed Laravel Fileable, open your Laravel config file if you use Laravel below 11, config/app.php and add the following lines.

In the $providers array add the service providers for this package.

If you use Laravel >= 11, open your bootstrap/providers.php and the above line to the array.

Initialization

To start using this library you are required to add your API keys to the .env file with these variables:

If you wish to interact directly with the base class, you might want to take a look at https://github.com/toneflix/cuttly-php

Initialization Errors

Where an API key has not not been provided, the library will throw a ToneflixCode\CuttlyPhp\Exceptions\InvalidApiKeyException exception on any other associated action call.

Regular API Usage

Shorten Url

To shorten a URL simply call the shorten(string) method chained to the regular() method of the Cuttly instance passing the link you intend to shorten as the only parameter.

The shorten() method returns an instance of ToneflixCode\CuttlyPhp\Builders\ShortenResponse which contains all properties of the request response returned by the API.

Chainable parameters

We have taken our time to ensure that while using this library, you have access to every available feature provided by cuttly in the first place, here is a list of parameters you can chain as methods to further customize your request.

Example Usage

Do note that shorten() should only be called at the end of the chain.

Edit Short Link

The library also allows you to edit the short links you have created. To edit a link simply call the edit(string) method chained to the regular() method of the Cuttly instance passing the short link you intend to edit as the only parameter.

Of course, the example above really does nothing and will throw a ToneflixCode\CuttlyPhp\Exceptions\FailedRequestException. To actually edit a link, you can chain any of the below methods to your call and voila.

Example Usage

The edit() method returns an instance of ToneflixCode\CuttlyPhp\Builders\BaseResponse which contains all properties of the request response returned by the API.

Link analytics

In order to access URL statistics call the stats(string) method chained to the regular() method of the Cuttly instance passing the short link you intend to get analytics of as the only parameter.

The stats() method returns an instance of ToneflixCode\CuttlyPhp\Builders\StatsResponse which contains all properties of the request response returned by the API.

Delete Short Link

To delete a short link call the delete(string) method chained to the regular() method of the Cuttly instance passing the short link you intend to get delete as the only parameter.

The delete() method returns an instance of ToneflixCode\CuttlyPhp\Builders\BaseResponse which contains all properties of the request response returned by the API.

Team API Usage

The team API implements the same methods and chainable methods available to the Regular API with a few exceptions that we will point out next.

TO use the Team API, instead of calling the regular() method on the Cuttly instance, we're going to call the team() method, you can now chain all the method we have highlighted above to use the Team API.

Shorten Link

Edit Short Link

Link analytics

Delete Short Link

Exceptions

ToneflixCode\CuttlyPhp\Exceptions\InvalidApiKeyException

The ToneflixCode\CuttlyPhp\Exceptions\InvalidApiKeyException exception is thrown whenever an API key has not been provided or an invalid API key has been provided.

ToneflixCode\CuttlyPhp\Exceptions\FailedRequestException

The ToneflixCode\CuttlyPhp\Exceptions\FailedRequestException exception is thrown whenever the Cuttly API returns an error.

Exception Handling

When you hit an exception, you can handle it in whatever way is best for your use case.

For detailed descriptino about what is obtainable from the API, please read the Cutt.ly Documentations.

Testing

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of cuttly-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2|^8.3
illuminate/support Version ^9.0|^10.0|^11.0
toneflix-code/cuttly-php Version ^1.0
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 toneflix-code/cuttly-laravel contains the following files

Loading the files please wait ....