Package Data | |
---|---|
Maintainer Username: | jiemoon |
Maintainer Contact: | jiemoon2010@gmail.com (jiemoon) |
Package Create Date: | 2017-04-06 |
Package Last Update: | 2017-04-09 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-02-07 15:05:14 |
Package Statistics | |
---|---|
Total Downloads: | 50 |
Monthly Downloads: | 2 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Laravel Package for translate string to english, then use it to create a slug.
If any of the following are applicable to your project, then the directory structure should follow industry best practises by being named the following..
src/
tests/
Via Composer
$ composer require jiemoon/chinese-slug
Modify .env
, Add Biadu Fanyi Config.
You can get the config, after register an account in api.fanyi.baidu.com
BAIDU_FANYI_API_ID=xxx
BAIDU_FANYI_API_SECRET=xxx
Edit cofig/app.php
Add Provider and Alias
Jiemoon\ChineseSlug\ChineseSlugServiceProvider::class,
...
'ChineseSlug' => Jiemoon\ChineseSlug\Facades\ChineseSlug::class,
$slug = \ChineseSlug::generateUniqueSlug($title, 'posts');
# or
$slug = app('chineseslug')->generateUniqueSlug($title, 'posts');
Please see CHANGELOG for more information on what has changed recently.
$ phpunit
The MIT License (MIT). Please see License File for more information.