定制 mactape/short-links 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

mactape/short-links

最新稳定版本:2.2.0

Composer 安装命令:

composer create-project mactape/short-links

包简介

url shortener

README 文档

README

Url Shortener

  • Laravel ^10.0, ^11.0 or ^12.0
  • PHP ^8.3

Installation

You can install the package via composer:

composer require mactape/short-links

You can publish and run the migrations with:

php artisan vendor:publish --tag="short-links-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="short-links-config"

configure in config/short-links.php

domain -> your application domain

expiration (default 12) integer in hours. Model will be pruned

Usage

create hash for url

$hash = ShortURL::generate('https://your-url-to-shorten');

now you can use like

return ShortURL::open($hash);

or navigate to https://your-application-domain/s/{hash}

Add to

\App\Console\Kernel schedule method if you use Laravel 10

$schedule->command('model:prune')->daily();

Or

Schedule::command('model:prune')->daily();

in your application's routes/console.php if you use Laravel >= 11

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-30