36 lines
445 B
PHP
Executable File
36 lines
445 B
PHP
Executable File
<?php
|
|
|
|
class Comment extends Eloquent {
|
|
|
|
/**
|
|
* Get the comment's content.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function content()
|
|
{
|
|
return nl2br($this->content);
|
|
}
|
|
|
|
/**
|
|
* Get the comment's author.
|
|
*
|
|
* @return User
|
|
*/
|
|
public function author()
|
|
{
|
|
return $this->belongsTo('User', 'user_id');
|
|
}
|
|
|
|
/**
|
|
* Get the comment's post's.
|
|
*
|
|
* @return Blog\Post
|
|
*/
|
|
public function post()
|
|
{
|
|
return $this->belongsTo('Post');
|
|
}
|
|
|
|
}
|