1. Go to this page and download the library: Download halilcosdu/laravel-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/ */
$thread = ChatBot::createThread('Why is the sky blue?', ownerId: auth()->id());
// Creates a Conversation, runs a Response against it, and stores the user
// message + assistant reply as ThreadMessage rows.
$assistantMessage = ChatBot::updateThread('What about at sunset?', $thread->id);