B Blengi docs

Laravel

Laravel package

Deze pagina is nog niet beschikbaar in het Nederlands, daarom lees je hem in het Engels.

On a Laravel site the widget and the answer block come from one Composer package: a Blade directive for the script and a Blade component for the block, configured in .env.

Install

composer require ai-assistant/laravel

Add to .env:

AI_ASSISTANT_AGENT_ID=your-agent-id
AI_ASSISTANT_HOST=https://blengi.com

The agent id is on the AI employee's Website page. Put @aiAssistantScript in your layout, just before </body>: every page then loads the widget.

The answer block

Where the block should go — a product page, for example — add <x-ai-answer />. Optional attributes: title, placeholder, layout (answer, the default, card or bar) and context (see Inline embed). An agency can change the component prefix with AI_ASSISTANT_COMPONENT_PREFIX; the page never shows a brand name.

Signed-in customers

Put the identity secret from the dashboard (Settings › Widget › Identify signed-in customers) in .env as AI_ASSISTANT_IDENTITY_SECRET and add @aiAssistantUser to the layout right before @aiAssistantScript. It prints the signed-in user's id signed with the secret, the e-mail address and the name, so the AI employee recognises the customer on every device — see Identify signed-in customers. Nothing is printed for a guest or without the secret; @aiAssistantUser($user) takes another user or an array with id, email and name.