PHP code example of awcodes / botly

1. Go to this page and download the library: Download awcodes/botly library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

awcodes / botly example snippets


use Awcodes\Botly\BotlyPlugin;

$panel->plugins([
    BotlyPlugin::make(),
]);

return [
    'defaults' => [
        'rules' => [],
        'sitemaps' => [],
        'ai_crawlers' => [],
    ],
    'persistent_rules' => [],
];

// config/botly.php
'persistent_rules' => [
    [
        'user_agent' => '*',
        'directive' => 'disallow',
        'path' => '/admin',
    ],
],

BotlyPlugin::make()
    ->persistentRules([
        [
            'user_agent' => '*',
            'directive' => 'disallow',
            'path' => '/admin',
        ],
    ]),

// Always deny access
BotlyPlugin::make()
    ->authorize(false),

// Conditionally allow access
BotlyPlugin::make()
    ->authorize(fn () => auth()->user()->isAdmin()),

BotlyPlugin::make()
    ->navigationIcon('heroicon-o-document-text')
    ->navigationGroup('Settings')
    ->navigationLabel('Robots.txt')
    ->navigationSort(3),

BotlyPlugin::make()
    ->title('Robots Manager')
    ->slug('robots-manager'),
bash
php artisan botly:install
bash
php artisan vendor:publish --tag="botly-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="botly-config"