{"id":36989041,"url":"https://github.com/overxue/slug","last_synced_at":"2026-01-13T23:28:18.730Z","repository":{"id":57034308,"uuid":"131256811","full_name":"overxue/slug","owner":"overxue","description":"chinese url slug support.","archived":false,"fork":false,"pushed_at":"2018-04-28T07:05:11.000Z","size":6,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-11T18:56:12.615Z","etag":null,"topics":["laravel","laravel-slug","slug"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/overxue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-27T06:44:14.000Z","updated_at":"2020-09-08T11:59:08.000Z","dependencies_parsed_at":"2022-08-23T20:50:30.926Z","dependency_job_id":null,"html_url":"https://github.com/overxue/slug","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/overxue/slug","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overxue%2Fslug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overxue%2Fslug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overxue%2Fslug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overxue%2Fslug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/overxue","download_url":"https://codeload.github.com/overxue/slug/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overxue%2Fslug/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28405102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","laravel-slug","slug"],"created_at":"2026-01-13T23:28:16.559Z","updated_at":"2026-01-13T23:28:18.713Z","avatar_url":"https://github.com/overxue.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eSlug\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e中文的 url slug 支持，目的是实现文章和帖子中文标题也可以使用 slug 类型的 url（目前只支持laravel框架中使用）\u003c/p\u003e\n\n## 安装\n\n这是一个标准的 Composer 包,你可以直接通过下面的命令行来安装:\n\n```shell\n$ composer require \"overxue/slug\"\n```\n\n## 在laravel中使用\n1. 在`config/services.php`中添加：\n```php\n'baidu' =\u003e [\n      'appId' =\u003e env('BAIDU_APP_ID'),\n      'appKey' =\u003e env('BAIDU_APP_KEY')\n  ],\n```\n在`.env`文件中添加 [百度开放平台](http://api.fanyi.baidu.com/api/trans/product/desktop?req=developer) 中申请的appid和秘钥(不配置appid和秘钥，程序会自动使用汉字转拼音方案来生成 Slug)\n```\nBAIDU_APP_ID=APP ID\nBAIDU_APP_KEY=密钥\n```\n2. 使用\n```php\n\napp('slug')-\u003etranslate('如何翻译laravel文档');\n// how-to-translate-laravel-documents\n// 不配置秘钥和appid返回     ru-he-fan-yi-laravel-wen-dang\n\n或者\n\nuse Overxue\\Slug\\Slug;\n\n$slug = new Slug(config('services.baidu'));\n$slug-\u003etranslate('如何翻译laravel文档');\n// how-to-translate-laravel-documents\n\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foverxue%2Fslug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foverxue%2Fslug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foverxue%2Fslug/lists"}