定制 oxyagency/laravel-5-robots 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

oxyagency/laravel-5-robots

最新稳定版本:1.0.0

Composer 安装命令:

composer require oxyagency/laravel-5-robots

包简介

Robots.txt Generator for Laravel 5

README 文档

README

Current Release Total Downloads Build Status Code Climate Test Coverage

This is a fork of https://github.com/jayhealey/Robots. It appears development has stalled on the original repository.

The purpose of this fork is to introduce Laravel 5 compatibility and PSR-4 and PSR-2 (for Laravel 5.1).

Installation

Step 1: Composer

Add the package to your composer.json:

{
    "require": {
        "ellisthedev/laravel-5-robots": "~0.1.0"
    }
}

Step 2: Configuration

Add the following to your config/app.php in the providers array:

'EllisTheDev\Robots\RobotsServiceProvider',

You can also optionally add the following to the aliases array:

'Robots' => 'EllisTheDev\Robots\RobotsFacade',

Usage

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.
        Robots::addUserAgent('*');
        Robots::addSitemap('sitemap.xml');
    } else {
        // If you're on any other server, tell everyone to go away.
        Robots::addDisallow('*');
    }

    return Response::make(Robots::generate(), 200, ['Content-Type' => 'text/plain']);
});

Refer to the Robots.php for API usage.

License

MIT

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固