i am using this script https://github.com/laravelista/comments to create comments on my site but i cant seem to get it working
any idea on what i am doing wrong
Thanks in advanced
I am getting the following error when i run @comments(['model' => $id])
ErrorException
Attempt to read property "comments" on string (View: /var/www/html/resources/views/vendor/comments/components/comments.blade.php)
my route :
Route::get('/video/{creator}/{video}/{id}', [Videocontroller::class, 'viewvideo'])->middleware('App\Http\Middleware\Subscribed','auth');
my controller:
`public function viewvideo($creator, $video, $id) {
$videourl = Storage::url($video);
return view("viewvideo", compact(['creator', 'video','id']));
}`
my view:
`<?php
$title = DB::table('videos')
->where('url', '=', $creator.'/'.$video)->get();
DB::table('videos')
->where('url', '=', $creator.'/'.$video)
->increment('views', 1);
$detect = new Mobile_Detect;
if( $detect->isAndroidOS() ){
echo "android is not yet fully supported";
}
?>
</x-slot>
<div class="py-12">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
@foreach($title as $t)
<div class="video-title"><h2>{{$t->title}}</h2></div>
<p> </p>
<details>
<summary>Description</summary>
<?php echo $t->description; ?>
Views: views; ?>
@Endforeach
@comments(['model' => $id])
</div>
</div>
</div>
</div>
`