Download the PHP package sharelov/sharelov-shortener without Composer

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

Sharelov : URL Shortener

develop master
StyleCI CircleCI StyleCI CircleCI

Installation

Require the package with Composer:

After that, add the ServiceProvider to the providers array in config/app.php

You can optionally use the facade. If you decide to use it, add this to your aliases array in config/app.php:

Then, run composer dump-autoload.

Afterwards, run php artisan vendor:publish to get the migration and config files.

Configuration

The config file has important configuration you may want to look at and customize before running the migrations. If you haven't looked at it yet, you can customize the table name in the config file, so there will be no need to fiddle with the migration yourself. Once you make sure the table name will not cause conflicts with your existing tables, run php artisan migrate to install the table we use.

There is also the posibility to configure any of the following things:

There is ample documentation for each option in the config file. Feel free to trim it down after having looked it over and setting it up.

Usage

Use this route to decode a shortened URL, if the URL doesn't exist it will run abort(404) otherwise it will perform a redirect to the stored url asociated with that hash.

Use this route to shorten a URL, if the URL already exists on the database it will return the hash code otherwise it will create a new URL|Hash tuple and it will return a json response with the hash and the url with the current domain indicating the status of the request.

The url receives the following query parameters:

Url to process by the shortener: url=urltoshorten

Expiration date for the link expires_at=YYYY-MM-DD (don't specify this in order to make the link not expire)

You can have an example of the requests on this postman collection: PostMan Shortener Collection

Succesfull json response

Unsuccessfull json response

For using the facade don't forget to include it use Shortener; and then you can call the next methods:

Returns the hash for the url sended as a parameter and stores an object in the links table.

Returns the url corresponding to a hash string in the database.

License

This Laravel package is licensed with the MIT License.


All versions of sharelov-shortener with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.5
laravel/framework Version ^9|^10
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 sharelov/sharelov-shortener contains the following files

Loading the files please wait ....