Download the PHP package cedaesca/urlshortener without Composer

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

License: MIT

URL Shortener

Shorten URL's using your own domain

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Installing

1) Download it into your Laravel app using composer

2) Publish the packages files `

3) Run the migrations. `

Customizing the URL's code length

1) Go to the config file located on config/cedaesca/URLShortener.php

2) Change the length value for that of your preference.

URLShortener Facade

You have to add the URLShortener facade to your controller: ``

Then you'll have access to the create and redirect methods.

Shorten URL's

Use the create static method to shorten a given URL. This method receives the request as argument and returns an instance of the model if was successfully created or false if not:

``

Redirecting users

First off, the redirection route expect a shortlink parameter, make sure to name it like that. Later, you can redirect the user to the expected target by returning Laravel's redirect response and giving the returning value of the target method as an argument. The target method also receives the \Illuminate\Http\Request instance.

Logging redirected clients

You may want to track some statistics with your shortened URL's. At the moment you can track their user agent, their IP Address and the timestamps. You can decide what to do with that info.

To achieve this, call the log method before the target one in your redirect response. Give the `\Illuminate\Http\Request as the argument and now you can leave the target argument blank.

``

Default redirect

If the code given as argument is invalid, the redirect method will redirect the user to a default route. Change this from the config file.

1) Go to the config file located on config/cedaesca/URLShortener.php

2) Change the default_redirect value for that of your preference.


All versions of urlshortener with dependencies

PHP Build Version
Package Version
No informations.
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 cedaesca/urlshortener contains the following files

Loading the files please wait ....