app\Post::comments PHP Method

comments() public method

public comments ( )
    public function comments()
    {
        return $this->hasmany('App\\Post_Comment');
    }

Usage Example

コード例 #1
0
ファイル: CommentController.php プロジェクト: enhive/vev
 public function store(Request $request, Post $post)
 {
     $comment = Comment::create($request->all());
     $post->comments()->save($comment);
     Score::create(['user_id' => Auth::user()->id, 'reference' => 'comment', 'score' => 2]);
     Auth::user()->increment('scores', 2);
     return redirect()->to('posts/' . $post->slug);
 }
All Usage Examples Of app\Post::comments