I just setup a new app with a video model. I get this error after installing comments (select count(*) as aggregate from comments where comments.video_id = 1 and comments.video_id is not null).
Below is my code:
<livewire:comments :model="$video" no-comments-text="What are your thoughts on this?" newest-first/>
@endauth
@guest
<livewire:comments read-only :model="$video"/>
<p class="comments-no-comment-yet">
Log in to make a comment...
</p>
@endguest```
```<?php
namespace App\Models;
use Cviebrock\EloquentSluggable\Sluggable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Overtrue\LaravelLike\Traits\Likeable;
use Spatie\Comments\Models\Concerns\HasComments;
class Video extends Model
{
use HasFactory, HasComments, Sluggable, Likeable;
protected $fillable = [
'channel_id',
'video_category_id',
'title',
'slug',
'description',
'video',
'thumbnail',
'is_public',
'is_approved'
];
/**
* Return the sluggable configuration array for this model.
*
* @return array
*/
public function sluggable(): array
{
return [
'slug' => [
'source' => 'title'
]
];
}
/*
* This string will be used in notifications on what a new comment
* was made.
*/
public function commentableName(): string
{
//
}
/*
* This URL will be used in notifications to let the user know
* where the comment itself can be read.
*/
public function commentUrl(): string
{
}```
Hi.
I just setup a new app with a video model. I get this error after installing comments (select count(*) as aggregate from
comments
wherecomments
.video_id
= 1 andcomments
.video_id
is not null).Below is my code: