Skip to content

Laravel 5.5 url-shrtener with Laravel Package Auto-Discovery, no more config/app tweaks

Notifications You must be signed in to change notification settings

madeny/url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel 5.5 url shortener

Smattering

URL shortener package with Laravel Package Auto-Discovery.

Installation and Setup

Require through composer

composer require madeny/url-shortener

Or manually edit your composer.json file:

"require": {
    "madeny/url-shortener": "1.0"
}

Config: .env to have this for bitly driver:

URL_SHORTENER_BITLY_USERNAME=username
URL_SHORTENER_BITLY_PASSWORD=password

for google driver:

URL_SHORTENER_GOOGLE_API_KEY=apikey

Usage

Shorten a url

```php
\UrlShortener::shorten('http://google.com'); // Uses default driver as per config settings
\UrlShortener::driver('bitly')->shorten('http://google.com');
```

Expand a url

```php
\UrlShortener::expand('http://google.com'); // Uses default driver as per config settings
\UrlShortener::driver('bitly')->expand('http://google.com');
```

About

Laravel 5.5 url-shrtener with Laravel Package Auto-Discovery, no more config/app tweaks

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages