Download the PHP package serbanblebea/urlshortener without Composer

On this page you can find all versions of the php package serbanblebea/urlshortener. 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 urlshortener

URL-Shortener

Menu

About URL-Shortener

URL-Shortener is a package for creating short url links that track conversions for Laravel apps or websites.

Just like bit.ly, you can create a url shortening service in your Laravel app.

Easy to install and easy to use.

Just read this file and let me know if I can help.

Install URL-Shortener

Add this to the composer.json file:

Or just use the command line:

composer require serbanblebea/urlshortener

Then add the Service Provider and the Facade to the config/app.php file

UrlShortenerServiceProvider

ShortUrl Facade

Use URL-Shortener

URL-Shortener is very easy to use:

Step 1. Create the table

Before using the package, use the command line php artisan migrate to migrate the database table links.

This will be used to store the data for the short urls and the visitor count for every link.

Step 2. Publish the config file

Run php artisan vendor:publish and select the package name to publish the config file url-shortener.php in the config folder.

!IMPORTANT If you change the special_route_param, all your existing linksspread across the internet will be nulled, so I would setup this option before using the package in production

Step 3. Create your first short url

After you migrated the table, it's time to create your first short url:

Step 4. Change the unique id

Every short url has an unique id that is used for accessing the destination link.

Exemple: http://your-domain.com/s/unique-id

Usually the unique id is string composed from 8 characters, so you may want to personalize it.

You can do that with:

This will be your new short url: http://your-domain.com/s/soda

Step 4. Count clicks of add Google UTM taggs

You can track clicks to your url directly from your app, or you can use Google Analytics.

Let's first look at how you can get the number of clicks from the database:

If you want something more advanced, let's add some tracking for Google Analytics.

Add tracking when you create the short url:

Or add tracking after you created the short url:

Step 5. Reset the tracking counter

There is a method to reset the tracking counter. Very easy to use.

Step 6. Special Commands

url:make

After you run php artisan vendor:publish (see above), you will also have access to a special command for creating short url from the CLI.

Just type php artisan url:make <just-url-after-app-root> <name-of-the-url>

For example: php artisan url:make /test/page/1 FirstBlogPost. This will create a short url with the name FirstBlogPost.

The name of the url can be nulled in the CLI, this will generate a random string that you can change later

url:print

You can print all your short url's with one command line php artisan url:print

If you want to search url by name, just add php artisan url:print --name=<name-of-url-here>

Also you can search by destination with php artisan url:print --dest=<name-of-destination-url>

Testing


All versions of urlshortener with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
illuminate/database Version >=5.0
illuminate/support Version >=5.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 serbanblebea/urlshortener contains the following files

Loading the files please wait ....