🔺 Laravel Guide

How to Add an AI Chatbot to Laravel

Laravel is the most popular PHP framework. Tuqlas integrates in seconds — just add the embed script to your Blade layout. It works with Livewire, Inertia.js, and standard Blade views.

01

Create a chatbot on Tuqlas

Sign up at tuqlas.com, create a chatbot, and copy your embed key.

02

Edit your Blade layout

Open your main layout file (e.g. resources/views/layouts/app.blade.php) and add the Tuqlas script before the closing </body> tag. Use an env variable for the key.

03

Deploy

The chat widget appears on every page that extends your layout. Works in local dev and production.

resources/views/layouts/app.blade.php
{{-- resources/views/layouts/app.blade.php --}}
<html>
<head>
    @yield('head')
</head>
<body>
    @yield('content')

    <script
      src="https://tuqlas.com/chatbot.js"
      data-key="{{ config('services.tuqlas.key') }}"
      defer
    ></script>
</body>
</html>
💡 Tip

Add TUQLAS_EMBED_KEY to your .env file and reference it in config/services.php as 'tuqlas' => ['key' => env('TUQLAS_EMBED_KEY')]. This keeps your key out of version control.

Ready to add a chatbot to Laravel?

Create your chatbot and get your embed key in under a minute.