1. Go to this page and download the library: Download rnkr69/lara-chatbot 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/ */
rnkr69 / lara-chatbot example snippets
// app/Chatbot/Tools/ListMyInvoicesTool.php
public function name(): string { return 'list_my_invoices'; }
public function description(): string { return 'List the user invoices.'; }
public function permissions(): array { return ['invoices.view']; }
public function defaultScope(): AccessScope { return AccessScope::Self; }
public function handle(array $args, ToolContext $ctx): ToolResult
{
$rows = $this->accessibleQuery(Invoice::query(), $ctx)->limit(20)->get();
return ToolResult::success(['items' => $rows->toArray()]);
}