PHP code example of arkitecht / laravel-hume

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

    

arkitecht / laravel-hume example snippets




use Arkitecht\LaravelHume\Facades\Hume;

$chats = Hume::listChats();
$chat = $chats->first();

print "The first chat is: " . $chat->getId() . ' with a status of ' . $chat->getStatus();



use Arkitecht\LaravelHume\Facades\Hume;
use Arkitecht\LaravelHume\Classes\Prompt;

$prompt = new Prompt();
$prompt->setName('Cool New Prompt')
    ->setText('<role>You are a helpful bot</role>');
    
Hume::createPrompt($prompt);



use Arkitecht\LaravelHume\Hume;

$humeService = new Hume('api_key','api_secret');

$chats = $humeService->usingAccessToken()->listChats();
$chat = $chats->first();

print "The first chat is: " . $chat->getId() . ' with a status of ' . $chat->getStatus();



use Arkitecht\LaravelHume\Hume;
use Arkitecht\LaravelHume\Classes\Prompt;

$humeService = new Hume('api_key','api_secret');

$prompt = new Prompt();
$prompt->setName('Cool New Prompt')
    ->setText('<role>You are a helpful bot</role>');
    
$humeService->createPrompt($prompt);
bash
php artisan vendor:publish --provider="Arkitecht\LaravelHume\HumeServiceProvider"