title: displaying a view immediately after the 'store' resource controller in laravel
body: <p>so at the moment my 'store' resource controller adds to the table in my database and fetches the view for my 'index' page (my home page) however when i refresh this view it duplicates the last row added to the database. i have noticed the URI is '<a href="http://127.0.0.1:8000/store" rel="nofollow noreferrer">http://127.0.0.1:8000/store</a>' instead of '<a href="http://127.0.0.1:8000/index" rel="nofollow noreferrer">http://127.0.0.1:8000/index</a>' can someone please explain what is going on. i apologise for the lack of technical terms i'm a new apprentice and am trying to figure this out using my own initiative but so far have had no luck. i also noticed that my log out function does the same thing although the URI is slightly different in that it still displays the CSRF token in the URI however it still says its at the 'logout' file path, here is an example of this; '<a href="http://127.0.0.1:8000/logout?_token=bqTl4J3EZyKj7LS5ZvqfRB8k1Qg02IT1j4WlBG51&amp;dir2login=" rel="nofollow noreferrer">http://127.0.0.1:8000/logout?_token=bqTl4J3EZyKj7LS5ZvqfRB8k1Qg02IT1j4WlBG51&amp;dir2login=</a>'</p>
  
  <p>FYI i have already tried return $this->index();</p>
  
  <p>my logout controller method;</p>
  
  <pre><code>  public function logout(){
    Auth::logout();
    return view('index',['posts'=&gt;$this-&gt;getTable()]);
  }
  </code></pre>
  
  <hr>
  
  <p>my store controller method:</p>
  
  <pre><code>public function store(Request $request){
    //creates new row in database table
    //$clientIp=$request-&gt;ip();
    $post = new PostModel();
    //gets email of user currently logged in
    $post-&gt;email=Auth::user()-&gt;email;
    $post-&gt;ip=$request-&gt;ip();
    $post-&gt;content=$request-&gt;content;
    $post-&gt;company=$request-&gt;company;
    $post-&gt;rating=$request-&gt;rating;
    //saves to database
    $post-&gt;save();
    return view('index',['posts'=&gt;$this-&gt;getTable()]);
  }
  </code></pre>