PHP Class app\repositories\CommentRepository

Show file Open project: forehalo/materialize-blog Class Usage Examples

Protected Properties

Property Type Description
$model Model
$post model

Public Methods

Method Description
__construct ( Comment $comment, Post $post ) CommentRepository constructor.
all ( $n ) : mixed Get all comments.
destroy ( $id )
getById ( $id ) : mixed Get comment by given id.
store ( $input ) Store a new comment.
toggleStatus ( $id, $column, $value ) Toggle comment column status.

Method Details

__construct() public method

CommentRepository constructor.
public __construct ( Comment $comment, Post $post )
$comment app\models\Comment
$post app\models\Post

all() public method

Get all comments.
public all ( $n ) : mixed
$n
return mixed

destroy() public method

public destroy ( $id )

getById() public method

Get comment by given id.
public getById ( $id ) : mixed
$id
return mixed

store() public method

Store a new comment.
public store ( $input )
$input

toggleStatus() public method

Toggle comment column status.
public toggleStatus ( $id, $column, $value )
$id
$column
$value

Property Details

$model protected property

Model
protected $model

$post protected property

model
protected $post