olssonm / l5-humans
为 Laravel 提供简单的 humans.txt 路由和视图。
v5.1
2020-12-06 09:40 UTC
Requires
- php: ^7.3|^8.0
- illuminate/support: ^6.0|^7.0|^8.0
Requires (Dev)
- orchestra/testbench: ^4.0|^5.0|^6.0
- orchestra/testbench-browser-kit: ^4.0|^5.0|^6.0
- phpunit/phpunit: ^8.0|^9.0
README
停止污染您的客户页脚,不要因为“由我的机构制作所以我在页脚放了一个链接”而放一个便宜的链接——那个页脚是您客户的财产。相反,如果您想要获得认可——添加一个简单的 humans.txt。
这个包所做的一切就是为 /humans.txt
添加一个路由和相关的视图。“为什么我需要这样一个包来处理这样简单的事情?”您可能会想。嗯,我也是直到我做了 20-30 次——这只是为了节省几分钟,但时间久了就积少成多了。
安装
通过 composer 安装
$ composer require olssonm/l5-humans
发布视图
$ php artisan vendor:publish --provider="Olssonm\Humans\ServiceProvider"
或者只需输入
$ php artisan vendor:publish
并选择 Olssonm\Humans\ServiceProvider
。
个性化定制
视图位于您的视图文件夹中 /humans/humans.blade.php
。
也可以将这个放在您的 <head>
中
<link type="text/plain" rel="author" href="http://domain.com/humans.txt" />
如果您需要通过命名路由访问您的 humans.txt
,这也是可能的
<link type="text/plain" rel="author" href="{{ route('humans.txt') }}" />
了解更多
在 humanstxt.org 了解更多关于 humans.txt 标准。
测试
$ composer test
或
$ phpunit
许可证
MIT 许可证(MIT)。请参阅 许可证文件 了解更多信息。
© 2021 Marcus Olsson。