PHPackages                             overxue/slug - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. overxue/slug

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

overxue/slug
============

中文的 url slug

1.0.0(8y ago)319MITPHPPHP &gt;=7.0

Since Apr 28Pushed 8y agoCompare

[ Source](https://github.com/overxue/slug)[ Packagist](https://packagist.org/packages/overxue/slug)[ RSS](/packages/overxue-slug/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Slug
====

[](#slug)

中文的 url slug 支持，目的是实现文章和帖子中文标题也可以使用 slug 类型的 url（目前只支持laravel框架中使用）

安装
--

[](#安装)

这是一个标准的 Composer 包,你可以直接通过下面的命令行来安装:

```
$ composer require "overxue/slug"
```

在laravel中使用
-----------

[](#在laravel中使用)

1. 在`config/services.php`中添加：

```
'baidu' => [
      'appId' => env('BAIDU_APP_ID'),
      'appKey' => env('BAIDU_APP_KEY')
  ],
```

在`.env`文件中添加 [百度开放平台](http://api.fanyi.baidu.com/api/trans/product/desktop?req=developer) 中申请的appid和秘钥(不配置appid和秘钥，程序会自动使用汉字转拼音方案来生成 Slug)

```
BAIDU_APP_ID=APP ID
BAIDU_APP_KEY=密钥

```

2. 使用

```
app('slug')->translate('如何翻译laravel文档');
// how-to-translate-laravel-documents
// 不配置秘钥和appid返回     ru-he-fan-yi-laravel-wen-dang

或者

use Overxue\Slug\Slug;

$slug = new Slug(config('services.baidu'));
$slug->translate('如何翻译laravel文档');
// how-to-translate-laravel-documents
```

License
-------

[](#license)

MIT

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2987d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/31536685?v=4)[XueCong](/maintainers/overxue)[@overxue](https://github.com/overxue)

---

Top Contributors

[![overxue](https://avatars.githubusercontent.com/u/31536685?v=4)](https://github.com/overxue "overxue (9 commits)")

---

Tags

laravellaravel-slugslugslugsdk

### Embed Badge

![Health badge](/badges/overxue-slug/health.svg)

```
[![Health](https://phpackages.com/badges/overxue-slug/health.svg)](https://phpackages.com/packages/overxue-slug)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.5k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k40](/packages/civicrm-civicrm-core)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[oat-sa/tao-core

TAO core extension

66143.7k120](/packages/oat-sa-tao-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
