laravelista / comments

Native comments for your Laravel application.
MIT License
745 stars 144 forks source link

Undefined property: stdClass::$Comments (View: C:\xampp\htdocs\All Lravel project\swe332\resources\views\vendor\comments\components\comments.blade.php) #96

Closed mirdostogir closed 4 years ago

mirdostogir commented 4 years ago

``@php

if (isset($approved) and $approved == true) {

    $comments = $model->approvedComments;

} else {

    $comments = $model->Comments; [get error this line please help me] 

}

@endphp

@if($comments->count() < 1)

<div class="alert alert-warning">There are no comments yet.</div>

@endif

mabasic commented 4 years ago

You are using $model->Comments (First letter is uppercase), when you should be using $model->comments (lowercase).

mirdostogir commented 4 years ago

using $model->comments (lowercase). but get same error

mabasic commented 4 years ago

Is the error now about the lowercase or uppercase? Why is it complaining about stdclass? Have you checked that you are passing the correct model.

Have you tried using the default views that came with this package? It looks like you are using your modified views.

zyryc commented 4 years ago

I have the same issue, Any solution yet ?