user5819198
user5819198

Reputation: 3

Trying to get property of non-object error help please

<div class="manga-created pull-right">
    <i class="fa fa-user"></i>
    <small><?php echo $manga->user->username; ?>,</small>
    <i class="fa fa-calendar-o"></i>
    <small><?php echo App::make("HelperController")->formateCreationDate($manga->created_at); ?></small>
</div>

This line here is where am getting the error at:

<small><?php echo $manga->user->username; ?>,</small>

Upvotes: 0

Views: 64

Answers (1)

As it looks like one of $manga or $manga->user is not an object. So it should be like one of these:

<?php echo $manga->user['username']; ?>

or

<?php echo $manga['user']->username; ?>

Upvotes: 1

Related Questions