Skip to content

Instantly share code, notes, and snippets.

@mikelbring
Created March 22, 2012 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikelbring/2158805 to your computer and use it in GitHub Desktop.
Save mikelbring/2158805 to your computer and use it in GitHub Desktop.
<?php
class Post extends Eloquent {
public static $table = 'posts';
public function comments()
{
return $this->has_many('Comment');
}
}
class Comment extends Eloquent {
public static $table = 'comments';
public function post()
{
return $this->belongs_to('Post');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment