Skip to content

PHP code snippet – How to display all posts assocatied to user in laravel?

class User extends Eloquent {

    public function posts() {
        return $this->hasMany('Post');


// in order to show it you need to do that in your blade file
See also  Java code snippet - How to hide menu items in android?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.