bnbwebexpertise/laravel-linkr

Laravel package to use PHP Linkr Client

1.0.4 2020-04-03 14:32 UTC

This package is auto-updated.

Last update: 2024-10-29 05:11:03 UTC


README

This package allows to generate short links with Linkr server.

Installation

You can install this package via composer. Laravel 5.5+ auto discovers the service provider.

composer require bnbwebexpertise/laravel-linkr

Configuration

You can customize this package behavior by publishing the configuration file :

php artisan vendor:publish --provider='Bnb\Laravel\Linkr\LinkrServiceProvider'

Settings can be changed using .env files :

LINKR_URL=https://my.linkr.server.com
LINKR_KEY=YourLinkrApiKey
LINKR_PROXY_CONFIG_KEY=services.proxy.http
LINKR_PROXY_USER_CONFIG_KEY=services.proxy.http_user
LINKR_PROXY_PASSWORD_CONFIG_KEY=services.proxy.http_password

Usage

//
//
// Via app()

$linkr = app('linker');

$link = $linkr->shorten(...);

$link = $linkr->details(...);

$linkr->delete(...);

//
//
// Via Facade

$link = Linkr::shorten(...);

$link = Linkr::details(...);

Linkr::delete(...);

See Linkr page for API details.