awcodes/botly
Composer 安装命令:
composer require awcodes/botly
包简介
Botly is a Filament plugin to manage your site's robots.txt file directly from a Filament admin panel.
README 文档
README
Botly is a Filament plugin to manage your site's robots.txt file directly from the Filament admin panel. Rules, sitemaps, and AI crawler blocks are stored in the database and served dynamically — no static file required.
Installation
Install the package via Composer:
composer require awcodes/botly
Run the installation command to publish migrations and run them:
php artisan botly:install
Or publish and run the migration manually:
php artisan vendor:publish --tag="botly-migrations"
php artisan migrate
Optionally publish the config file:
php artisan vendor:publish --tag="botly-config"
Setup
Register the plugin in your Filament panel provider:
use Awcodes\Botly\BotlyPlugin; $panel->plugins([ BotlyPlugin::make(), ]);
That's it. Botly registers a Robots Manager page in your panel and automatically serves /robots.txt via a dynamic route.
How It Works
Botly stores your robots configuration in the database. When /robots.txt is requested, the rules are read from the database and formatted as valid robots.txt output on the fly. You can also export the current configuration to a static public/robots.txt file using the Export Robots.txt button on the admin page.
Important
If a static public/robots.txt file already exists, Botly will display a warning in the admin UI. The file must be deleted or renamed before the dynamic route can take effect.
Configuration
The published config file (config/botly.php) allows you to set default values that are used when no database record exists yet:
return [ 'defaults' => [ 'rules' => [], 'sitemaps' => [], 'ai_crawlers' => [], ], 'persistent_rules' => [], ];
Persistent Rules
Persistent rules are rules that are always included in the output and cannot be edited or deleted from the admin UI. You can define them in the config file or fluently on the plugin:
Via config:
// config/botly.php 'persistent_rules' => [ [ 'user_agent' => '*', 'directive' => 'disallow', 'path' => '/admin', ], ],
Via plugin:
BotlyPlugin::make() ->persistentRules([ [ 'user_agent' => '*', 'directive' => 'disallow', 'path' => '/admin', ], ]),
Each rule is an array with three keys:
| Key | Values |
|---|---|
user_agent |
Any string, e.g. *, Googlebot |
directive |
allow, disallow, crawl-delay, clean-param |
path |
The path to allow or disallow, e.g. /admin |
Customization
Authorization
By default, all users with access to your Filament panel can visit the Botly page. You can restrict access by passing a boolean or a closure to authorize():
// Always deny access BotlyPlugin::make() ->authorize(false), // Conditionally allow access BotlyPlugin::make() ->authorize(fn () => auth()->user()->isAdmin()),
Navigation
BotlyPlugin::make() ->navigationIcon('heroicon-o-robot') ->navigationGroup('Settings') ->navigationLabel('Robots.txt'),
Page
BotlyPlugin::make() ->title('Robots Manager') ->slug('robots-manager'),
AI Crawler Blocking
The admin page includes a Block AI Crawlers checkbox list. Selecting crawlers will add Disallow: / entries for each one in the output. Botly ships with a curated list of known AI crawlers including GPTBot, ClaudeBot, PerplexityBot, and more.
Testing
composer test
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
awcodes/botly 适用场景与选型建议
awcodes/botly 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 823 次下载、GitHub Stars 达 4, 最近一次更新时间为 2026 年 03 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「robots.txt」 「robots」 「laravel」 「filament」 「awcodes」 「botly」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 awcodes/botly 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 awcodes/botly 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 awcodes/botly 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A simple plugin that adds a twig tag to obfuscate email addresses (by rot13) in text fields.
Robots.txt Generator
A route for serving a basic robots.txt in Laravel 5.1+, based on configuration settings.
Agnostic model to efficiently query and scroll any kind of data (SQL, Search engine, HTTP API, CSV, ...) and push them anywhere with a ETL
Laravel 5.x helpers for a semi-automated robots.txt and meta tags
Generate custom robots.txt for subsites
统计信息
- 总下载量: 823
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-05