div-art/shortlink 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

div-art/shortlink

最新稳定版本:0.2.4

Composer 安装命令:

composer require div-art/shortlink

包简介

A Laravel 5.5 shortener package

README 文档

README

Short Link package for Laravel 5.5

Installation

To install, run the following in your project directory:

$ composer require div-art/shortlink

Then in config/app.php add the following to the providers array:

\DivArt\ShortLink\ShortLinkServiceProvider::class,

Also in config/app.php, add the Facade class to the aliases array:

'ShortLink' => \DivArt\ShortLink\Facades\ShortLink::class,

Configuration

To publish ShortLink's configuration file, run the following vendor:publish command:

php artisan vendor:publish --provider="DivArt\ShortLink\ShortLinkServiceProvider"

This will create a shortlink.php in your config directory. Here you must enter your Shortener URL API Key.

Usage

Be sure to include the namespace for the class wherever you plan to use this library

use DivArt\ShortLink\Facades\ShortLink;

To shorten a URL:

$url = "https://www.google.com";

ShortLink::google($url);

// return https://goo.gl/Njku

To get stats of clicks on shortened URL:

$url = https://goo.gl/Njku;

ShortLink::clicks($url);

Methods

ShortLink::google(); // return shortener url like goo.gl/XXXXXX

ShortLink::bitly(); // return shortener url like bit.ly/XXXXXX

ShortLink::rebrandly(); // return shortener url like rebrand.ly/XXXXXX

ShortLink::clicks(); // return count of clicks on a shortener url

ShortLink::expand(); // return long url

Services

goo.gl

bit.ly

rebrand.ly

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 11.32k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 4
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-01-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固