title: Method App\Http\Controllers\CommentsController::store does not exist. - Laravel 5.8
body: <p>I keep getting this error whenever I write a comment in my news article or section.  I cant resolve this error. I tried several methods but I cant solve. Anybody has an idea how to get rid of this? Please tell me. Thank you</p>
  
  <p>CommentsController.php</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  use App\Comment;
  use App\News;
  use App\Graph;
  use Validator;
  use Session;
  
  
  
  
  class CommentsController extends Controller
  {
      /**
       * Display a listing of the resource.
       *
       * @return \Illuminate\Http\Response
       */
      public function index()
      {
          //
      }
  
      /**
       * Show the form for creating a new resource.
       *
       * @return \Illuminate\Http\Response
       */
      public function create()
      {
          //
      }
  
      /**
       * Store a newly created resource in storage.
       *
       * @param  \Illuminate\Http\Request  $request
       * @return \Illuminate\Http\Response
       */
      public function store(Request $request, $news_id)
      {
          //
          $this-&gt;validate($request, array(
              'name'=&gt; 'required | max:255',
              'email'=&gt; 'required| email | max:255',
              'comment'=&gt; 'required | min:5'
          ));
  
          $news = News::find($news_id);
  
          $comment = new Comment();
  
          $comment-&gt;name = $request-&gt;name;
          $comment-&gt;email = $request-&gt;email;
          $comment-&gt;comment = $request-&gt;comment;
          $comment-&gt;approved = true;
          $comment-&gt;news()-&gt;associate($news);
  
          $comment-&gt;save();
  
          Session::flash('success', "Comment Added! ");
  
          return redirect()-&gt;route('article/',[$news-&gt;id]);
  
  
  
      }
  
      /**
       * Display the specified resource.
       *
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function show($id)
      {
          //
      }
  
      /**
       * Show the form for editing the specified resource.
       *
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function edit($id)
      {
          //
      }
  
      /**
       * Update the specified resource in storage.
       *
       * @param  \Illuminate\Http\Request  $request
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function update(Request $request, $id)
      {
          //
      }
  
      /**
       * Remove the specified resource from storage.
       *
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function destroy($id)
      {
          //
      }
  }
  
  </code></pre>
  
  <p>web.php</p>
  
  <pre><code>&lt;?php
  
  /*
  |--------------------------------------------------------------------------
  | Web Routes
  |--------------------------------------------------------------------------
  |
  | Here is where you can register web routes for your application. These
  | routes are loaded by the RouteServiceProvider within a group which
  | contains the "web" middleware group. Now create something great!
  |
  */
  
  
  
  Route::get('/adminlogin', 'Auth\LoginController@showLoginForm')-&gt;name('login');
  Route::post('/adminlogin', 'Auth\LoginController@login');
  
  
  // Registration Routes...
  Route::get('register/', 'Auth\RegisterController@showRegistrationForm')-&gt;name('register');
  Route::post('register/', 'Auth\RegisterController@register');
  
  
  
  
  
  
  //CRUD ROUTE COLLECTIVE
  Route::resource('users','UserController');
  
  //CRUD COLLECTIVE NEWS
  Route::resource('news', 'NewsController');
  
  //CRUD COLLECTIVE ROADMAP
  Route::resource('roadmap', 'RoadmapController');
  
  //dashboard
  Route::get('/home', 'HomeController@index')-&gt;name('home');
  
  
  Route::get('/', 'GraphController@index');
  
  //for user logout
  Route::get('/logout', 'HomeController@logout');
  
  
  
  
  //show individual news
  Route::group(['middleware'=&gt;['web']], function(){
      Route::get('/article/{id}', 'NewsController@showNews')-&gt;name('article');
  
  });
  
  
  
  
  
  //comments
  Route::post('comments/{news_id}', ['uses' =&gt; 'CommentsController@store ', 'as' =&gt; 'comments.store']);
  // Route::post('comments/{news_id}','CommentsController@store');
  
  
  
  
  
  </code></pre>
  
  <p>Comment.php Model</p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  class Comment extends Model
  {
  
      protected $fillable = [
          'name', 'email', 'comment',
      ];
      //
      public function news(){
          return $this-&gt;belongsTo('App\News');
      }
  }
  
  </code></pre>
  
  <p>News.php Model</p>
  
  <pre><code>
  &lt;?php
  
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  class news extends Model
  {
      //
      protected $fillable = [
          'title', 'subtitle', 'body', 'image',
      ];
  
  
      public function comments(){
          return $this-&gt;hasMany('App\Comment');
      }
  }
  
  </code></pre>
  
  <p>shownews.blade.php -(i only posted the code in my form because the code in this file is too long)</p>
  
  <pre><code> &lt;div id="comments" class="comments-area"&gt;
                      &lt;div id="respond" class="comment-respond"&gt;
                        &lt;h3 id="reply-title" class="comment-reply-title"&gt;
                          &lt;div class="leave-a-comment-title"&gt;Leave a &lt;span&gt;comment &lt;/span&gt;&lt;/div&gt;
  
                        &lt;/h3&gt;
  
                      {!! Form::open(['route'=&gt;['comments.store', $news-&gt;id], 'method'=&gt;'POST']) !!}
  
                          &lt;div class="row"&gt;
                            &lt;div class="col-md-4 col-12 form-group"&gt;
                             {!! Form::label('name', 'Name:') !!}
                             {!! Form::text('name', null, ['class'=&gt;'form-control'])!!}
                            &lt;/div&gt;
                            &lt;div class="col-md-4 col-12 form-group"&gt;
                              {{Form::label('email', 'Email:') }}
                              {!!Form::text('email', null, ['class'=&gt;'form-control'])!!}
                            &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class="row"&gt;
                            &lt;div class="col-12 form-group"&gt;
                              {!! Form::label('comment', 'Comment:') !!}
                              {!! Form::textarea('comment', null, ['class'=&gt;'form-control'])!!}
  
  
                            &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class="form-submit"&gt;
                            {!!Form::submit ('Add Comment', ['class'=&gt;'btn btn-warning'])!!}
                          &lt;/div&gt;
  
                        {!!Form::close()!!}
                      &lt;/div&gt;
                    &lt;/div&gt;
  
                &lt;/div&gt;
  </code></pre>
  
  <p>Route list</p>
  
  <pre><code>+--------+-----------+------------------------+-----------------+-------------------------------------------------------------------+--------------+
  |        | GET|HEAD  | /                      |                 | App\Http\Controllers\GraphController@index                        | web          |
  |        | POST      | adminlogin             |                 | App\Http\Controllers\Auth\LoginController@login                   | web,guest    |
  |        | GET|HEAD  | adminlogin             | login           | App\Http\Controllers\Auth\LoginController@showLoginForm           | web,guest    |
  |        | GET|HEAD  | api/user               |                 | Closure                                                           | api,auth:api |
  |        | GET|HEAD  | article/{id}           | article         | App\Http\Controllers\NewsController@showNews                      | web          |
  |        | POST      | comments/{news_id}     | comments.store  | App\Http\Controllers\CommentsController@store                     | web          |
  |        | GET|HEAD  | home                   | home            | App\Http\Controllers\HomeController@index                         | web          |
  |        | GET|HEAD  | logout                 |                 | App\Http\Controllers\HomeController@logout                        | web          |
  |        | GET|HEAD  | news                   | news.index      | App\Http\Controllers\NewsController@index                         | web          |
  |        | POST      | news                   | news.store      | App\Http\Controllers\NewsController@store                         | web          |
  |        | GET|HEAD  | news/create            | news.create     | App\Http\Controllers\NewsController@create                        | web          |
  |        | DELETE    | news/{news}            | news.destroy    | App\Http\Controllers\NewsController@destroy                       | web          |
  |        | GET|HEAD  | news/{news}            | news.show       | App\Http\Controllers\NewsController@show                          | web          |
  |        | PUT|PATCH | news/{news}            | news.update     | App\Http\Controllers\NewsController@update                        | web          |
  |        | GET|HEAD  | news/{news}/edit       | news.edit       | App\Http\Controllers\NewsController@edit                          | web          |
  |        | GET|HEAD  | register               | register        | App\Http\Controllers\Auth\RegisterController@showRegistrationForm | web,guest    |
  |        | POST      | register               |                 | App\Http\Controllers\Auth\RegisterController@register             | web,guest    |
  |        | POST      | roadmap                | roadmap.store   | App\Http\Controllers\RoadmapController@store                      | web          |
  |        | GET|HEAD  | roadmap                | roadmap.index   | App\Http\Controllers\RoadmapController@index                      | web          |
  |        | GET|HEAD  | roadmap/create         | roadmap.create  | App\Http\Controllers\RoadmapController@create                     | web          |
  |        | GET|HEAD  | roadmap/{roadmap}      | roadmap.show    | App\Http\Controllers\RoadmapController@show                       | web          |
  |        | PUT|PATCH | roadmap/{roadmap}      | roadmap.update  | App\Http\Controllers\RoadmapController@update                     | web          |
  |        | DELETE    | roadmap/{roadmap}      | roadmap.destroy | App\Http\Controllers\RoadmapController@destroy                    | web          |
  |        | GET|HEAD  | roadmap/{roadmap}/edit | roadmap.edit    | App\Http\Controllers\RoadmapController@edit                       | web          |
  |        | GET|HEAD  | test                   |                 | App\Http\Controllers\GraphController@test                         | web          |
  |        | POST      | users                  | users.store     | App\Http\Controllers\UserController@store                         | web          |
  |        | GET|HEAD  | users                  | users.index     | App\Http\Controllers\UserController@index                         | web          |
  |        | GET|HEAD  | users/create           | users.create    | App\Http\Controllers\UserController@create                        | web          |
  |        | DELETE    | users/{user}           | users.destroy   | App\Http\Controllers\UserController@destroy                       | web          |
  |        | PUT|PATCH | users/{user}           | users.update    | App\Http\Controllers\UserController@update                        | web          |
  |        | GET|HEAD  | users/{user}           | users.show      | App\Http\Controllers\UserController@show                          | web          |
  |        | GET|HEAD  | users/{user}/edit      | users.edit      | App\Http\Controllers\UserController@edit                          | web          |
  +--------+-----------+------------------------+-----------------+-------------------------------------------------------------------+--------------+
  </code></pre>