laravelista / comments

Native comments for your Laravel application.
MIT License
744 stars 143 forks source link

Attempt to read property "comments" on string #192

Closed matb987 closed 2 years ago

matb987 commented 2 years ago

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";
    }

            ?>

@foreach($title as $t)

{{$t->title}}

Description description; ?>
Views: views; ?> @endforeach @comments(['model' => $id])

`