Download the PHP package codeofdigital/laravel-url-shortener without Composer

On this page you can find all versions of the php package codeofdigital/laravel-url-shortener. 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 laravel-url-shortener

Laravel URL Shortener

Powerful URL shortening tool using different drivers for your Laravel projects

Latest Version on Packagist Latest Release on GitHub Build Status PHP from Packagist GitHub license

Table of Contents

Overview

A Laravel package that is used to shorten URLs according to your needs using your desired URL shortening drivers. Every driver will provide different features and function so do please check their documentation and pricing for different usages.

Installation

Requirements

The package has been developed to work with the following versions and minimum requirements:

Install Pacakge

You can install the package via the latest Composer:

Publish Config

You can then publish the package's config file by using the following command:

Usage

The quickest way to get started with creating a shortened URL is by using the snippet below. The method will return a shortened URL link, and you can freely use it within your system.

Instantiate Shortener

The URL Shortener can be retrieved from the container in few ways:

This package also comes with the URL Shortener facade to instantiate the class:

You can also use dependency injection to inject in one of your controller's method:

Once you have instantiate the URL Shortener class, you can use the methods and shorten your URLs:

The URL Shortener provides the following methods to use:

Method Description
shorten Shorten the given URL
shortenAsync Shorten the given URL asynchronously
driver Set the driver and create the driver instance

Changing Driver

You can change the default driver by setting URL_SHORTENER_DRIVER={driver} in your environment file or publish the config file and make your changes there directly.

Available Drivers

There are total of 8 drivers available in this package. By default, this package will use Bit.ly as the main driver. Below is a list of drivers with their respective specs:

Service API Token Driver name Analytics Monetization
Bit.ly yes bit_ly yes no
TinyURL yes tiny_url no no
Shorte.st yes shorte_st yes yes
Is.gd no is_gd yes no
Cutt.ly yes cutt_ly yes no
HideUri no hide_uri no no
Firebase Links yes firebase yes no
Ouo.io no ouo_io yes yes

Bit.ly

Official Website

The main default driver for this package. It runs on Bit.ly API and currently using Version 4. To access the Bit.ly driver in this package, you need to provide generic access token for OAuth Authentication which can be retrieved in their Bit.ly Link Management Dashboard. You can parse in your own custom short URL domain (Paid Version) as well. Currently, there are 2 variables that needs to be set to use the driver.

Variable Description
URL_SHORTENER_API_TOKEN Bit.ly API token
URL_SHORTENER_PREFIX Custom short URL domain, by default it's bit.ly

TinyURL

Official Website

Driver that runs on TinyURL API and currently using Version 2. To access the TinyURL driver in this package, you need to provide the API token for OAuth Authentication which can be retrieved in the TinyURL's account setting. You can parse in your own custom short URL domain (Paid Version) as well. TinyURL provides 3 free custom URL domain prefix which you can check out at their website. Currently, there are 2 variables that needs to be set to use the driver.

Variable Description
URL_SHORTENER_API_TOKEN TinyURL API token
URL_SHORTENER_PREFIX Custom short URL domain, by default it's tinyurl.com

Shorte.st

Official Website

Driver that runs on Shorte.st API and currently using Version 1. To access the Shorte.st driver in this package, you need to provide an access token which can be retrieved after you have register for a Shorte.st account. This driver has monetization support where each link that has been clicked will earn a small amount of cash. Currently, there are only 1 variable that needs to be set to use the driver.

Variable Description
URL_SHORTENER_API_TOKEN Shorte.st API token

Is.gd

Official Website

Driver that runs on Is.gd API and currently using Version 1. No API token is needed for this API as there is no authentication required when sending API request. Currently, there are only 1 variable that needs to be set to use the driver. This variable determines whether statistic is enabled or disabled when shorten an URL link.

Variable Description
URL_SHORTENER_ANALYTICS Enable or disable statistics

Cutt.ly

Official Website

Driver that runs on Cutt.ly API and currently using Version 1. To access the Cutt.ly driver in this package, you need to provide an API token which can be retrieved in Cutt.ly dashboard. API token will be used within the query parameters as a method of authentication. This driver comes with analytics and statistics. Currently, there are only 1 variable that needs to be set to use the driver.

Variable Description
URL_SHORTENER_API_TOKEN Cutt.ly API token

Hide.uri

Official Website

Driver that runs on Hide.uri API and currently using Version 1. No API token is needed for this API as no authentication is required when sending API request. No variable is needed to setup the driver and you can use straight out of the box. Check the official website if there is any rate limiting on API calls.

Firebase Links

Official Website

Driver that runs on Google Firebase API and currently using Version 1. To access the Firebase driver in this package, you need to provide an access token and a URI prefix which can be retrieved in your Firebase console Web API Token. The URI prefix can be set using your own custom domain or any names and it must ends with .page.link. The suffix can have the value SHORT or UNGUESSABLE.

Variable Description
URL_SHORTENER_API_TOKEN Firebase API token
URL_SHORTENER_PREFIX Custom URL prefix
URL_SHORTENER_SUFFIX Creation method during URL shortening

Ouo.io

Official Website

Driver that runs on Ouo.io API and currently using Version 1. To access the Ouo.io driver in this package, provide the API token that is available in the Ouo.io account dashboard. This driver has monetization support where each link that has been clicked will earn a small amount of cash.

Variable Description
URL_SHORTENER_API_TOKEN Ouo.io API token

Changelog

Please see CHANGELOG for more information what has been changed in recent versions.

Security

If you discover any security related issues, please email one of the authors instead of using the issue tracker. You can find the author emails in the composer.json.

Credits

License

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


All versions of laravel-url-shortener with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^8.0
guzzlehttp/guzzle Version ^6.2 || ^7.0
guzzlehttp/promises Version ^1.0
guzzlehttp/psr7 Version ^1.4
psr/http-message 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 codeofdigital/laravel-url-shortener contains the following files

Loading the files please wait ....