PHP code example of fleetbase / ai

1. Go to this page and download the library: Download fleetbase/ai 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/ */

    

fleetbase / ai example snippets


$this->callAfterResolving(\Fleetbase\Ai\Support\Commands\AiCommandRegistry::class, function ($commands) {
    $commands->registerMany([[
        'id'          => 'my-extension.widgets.create',
        'label'       => 'Create widget',
        'breadcrumb'  => 'My Extension › Widgets',
        'description' => 'Open the new widget form.',
        'steps'       => [
            ['type' => 'navigate', 'route' => 'console.my-extension.widgets.index'],
            ['type' => 'service', 'engine' => '@vendor/my-extension-engine', 'service' => 'widget-actions', 'method' => 'modal.create'],
        ],
        'permissions' => ['my-extension create widget'],
    ]]);
});