> For the complete documentation index, see [llms.txt](https://lakm.gitbook.io/commenter/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lakm.gitbook.io/commenter/basics/installation.md).

# Installation

#### Step 1 :

```bash
composer require lakm/laravel-comments -W
```

#### Step 2 :

```bash
php artisan commenter:install
```

#### Step 3 :

Include styles in your layout.

```html
<html>
    <head>
        @commenterStyles
    </head>
</html>
```

{% hint style="info" %}
To avoid CSS name conflicts, we recommend adding your styles to the end of the head tag.
{% endhint %}

Include scripts in your layout

```html
<html>
    <body>
        @commenterScripts
    </body>
</html>
```

#### Manually including Livewire's frontend assets <a href="#manually-including-livewires-frontend-assets" id="manually-including-livewires-frontend-assets"></a>

If you manually include livewire frontend ([documentation](https://livewire.laravel.com/docs/installation#manually-bundling-livewire-and-alpine)) assets make sure `@commenterStyles` is included before `@livewireStyles` and`@commenterScripts` is included before the `@livewireScripts`

```html
<html>
    <head>
        @commenterStyles
        @livewireStyles
    </head>
    <body>
        @commenterScripts
        @livewireScripts
    </body>
</html>
```

#### Manually bundling Livewire and Alpine <a href="#manually-bundling-livewire-and-alpine" id="manually-bundling-livewire-and-alpine"></a>

If you manually bundle livewire frontend ([documentation](https://livewire.laravel.com/docs/installation#manually-bundling-livewire-and-alpine)) assets make sure `@commenterStyles` is included before `@livewireStyles` and`@commenterScripts` is included before the script that includes livewire bundle.

```
<html>
<head>
    @commenterStyles
    @livewireStyles
    
    @commenterScripts
    @vite(['resources/js/app.js'])
</head>
<body>
    {{ $slot }}
 
    @livewireScriptConfig 
</body>
</html>
```

{% hint style="info" %}
To improve performance we recommend adding script at the end of the body tag.
{% endhint %}

Optionally you can publish the views using below command,

```bash
php artisan vendor:publish --tag=commenter-views
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lakm.gitbook.io/commenter/basics/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
