Created
March 22, 2012 14:55
-
-
Save mikelbring/2158805 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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