app/Http/Controllers/CommentController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Post $post)
    {
      $this->validate(request(), ['body' => 'required|min:2']);
      $post->addComment(request('body'));
      return back();
    }
public function store ( Post $ post ) { $ this -> validate ( request ( ) , [ 'body' => 'required|min:2' ] ) ; $ post -> addComment ( request ( 'body' ) ) ; return back ( ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .