djstarcom/laravel-robots-manager
Composer 安装命令:
composer require djstarcom/laravel-robots-manager
包简介
Laravel robots.txt manager
README 文档
README
Installation
First, install the package via composer:
composer require "djstarcom/laravel-robots-manager"
The package will automatically register itself.
Usage
Delete projects default public/robots.txt
Add the following to your routes file:
Route::get('robots.txt', function () { if (App::environment() == 'production') { // If on the live server, serve a nice, welcoming robots.txt. RobotsManager::addUserAgent('*'); RobotsManager::addSitemap('sitemap.xml'); } else { // If you're on any other server, tell everyone to go away. RobotsManager::addDisallow('*'); } return Response::make(RobotsManager::generate(), 200, ['Content-Type' => 'text/plain']); });
Refer to the RobotsManager.php for API usage.
License
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-02-28