🔨Installation

Step 1 :

composer require lakm/commenter -W

Step 2 :

php artisan commenter:install

Step 3 :

Include styles in your layout.

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

To avoid CSS name conflicts, we recommend adding your styles to the end of the head tag.

Include scripts in your layout

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

Manually including Livewire's frontend assets

If you manually include livewire frontend (documentation) assets make sure @commenterStyles is included before @livewireStyles and@commenterScripts is included before the @livewireScripts

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

Manually bundling Livewire and Alpine

If you manually bundle livewire frontend (documentation) 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>

To improve performance we recommend adding script at the end of the body tag.

Optionally you can publish the views using below command,

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

Last updated

Was this helpful?