Appearance
page_id
@php $pageId = 'post-'.$post->id; @endphp <x-blade-comments-box :pageId="$pageId" />
Alias:
<x-blade-comments::box :pageId="$pageId" />
Whitelist the class in config/vgcomment.php:
config/vgcomment.php
'allowed_commentable_types' => [ \App\Models\Post::class, ],
Then:
<x-blade-comments-box :commentable="$post" />
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="csrf-token" content="{{ csrf_token() }}"> @commentBladeStyles </head> <body> <x-blade-comments-box pageId="blog-1" /> @commentBladeScripts </body> </html>
CommentService
apiBase
comments.js
/{prefix}/api
You do not need Livewire, Alpine, or Echo for the Blade UI.
Use different pageId (or models) per instance:
pageId
<x-blade-comments-box pageId="section-a" /> <x-blade-comments-box pageId="section-b" />
Same core admin as Livewire apps: Admin panel.
Blade — Usage
Comment box by
page_idAlias:
Comment box on an Eloquent model
Whitelist the class in
config/vgcomment.php:Then:
Minimal page
How it works
CommentService.apiBase, CSRF, guest flags, context, …).comments.jstalks to/{prefix}/apifor create/update/react/upload.You do not need Livewire, Alpine, or Echo for the Blade UI.
Multiple boxes
Use different
pageId(or models) per instance:Admin
Same core admin as Livewire apps: Admin panel.