1. Go to this page and download the library: Download inceptia-io/larabrain 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/ */
inceptia-io / larabrain example snippets
'ui' => [
'enabled' => true,
'prefix' => 'brain', // URL prefix
'middleware' => ['web', 'auth'], // Remove 'auth' to make public
],
'middleware' => ['web'],
use AppBrain;
$response = AppBrain::ask('How does the order placement flow work?');
echo $response->answer;
echo $response->intent->label(); // e.g. "Explain Workflow"
echo $response->driver; // e.g. "openai"
echo $response->elapsedMs;
use Arafat\Brain\AI\Intent;
use Arafat\Brain\AI\IntentMap;
IntentMap::extend(Intent::ExplainWorkflow, ['pipeline', 'journey', 'sequence']);
use Brain;
$context = Brain::context('order');
$context->models; // Collection of matched model data
$context->tables; // Collection of matched table data
$context->routes; // Collection of matched route data
$context->controllerMethods; // Collection of matched controller method data
$context->elapsedMs;