title: How to solve Laravel 419 csrf token error
body: <p>I know that mostly the <code>419 error</code> has to do with <code>csrf</code> token in <code>Laravel</code> and I have correctly added <code>meta</code> tag and attach it with every <code>ajax</code> request. The page I am having problem with is not <code>ajax</code> submission.</p>
  
  <pre><code>&lt;meta name="csrf-token" content="{{ csrf_token() }}"&gt;
  </code></pre>
  
  <p>For any other forms I am using <a href="https://github.com/spatie/laravel-html" rel="nofollow noreferrer">spatie/laravel-html</a> repo so it adds <code>_token</code> on all the forms.</p>
  
  <p>Following is the <code>html</code> of one of the form</p>
  
  <pre><code>&lt;form method="POST" action="https://example.com/login" class="needs-validation"&gt;
      &lt;input type="hidden" name="_token" value="NmvrH2BZtzCg4ity9cRDG9JXgJER3EUtO0BnXxGH"&gt;
      &lt;div class="form-group"&gt;
          &lt;label for="email" class="form-control-label required"&gt;Email&lt;/label&gt;
          &lt;input type="email" name="email" id="email" placeholder="Email" required="required" class="form-control"&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          &lt;label for="password" class="form-control-label required"&gt;Password&lt;/label&gt;
          &lt;input type="password" name="password" id="password" placeholder="Password" required="required" class="form-control"&gt;
      &lt;/div&gt;
      &lt;div&gt;
          &lt;span data-href="https://example.com/register" class="clickable-row btn float-left"&gt;Sign Up&lt;/span&gt;
          &lt;button type="submit" class="btn float-right"&gt;Login&lt;/button&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>In my project only one route <code>/account</code> is causing <code>419 error</code>. Strange thing is that it throws error when clicked on <code>update</code> first time and then if I go back to the same page it works.</p>
  
  <p>I have tried clearing <code>cache</code>, changing route name or change the folder permission of <code>storage</code> on production but nothing seems to solve the issue.</p>
  
  <p>What else can I do to resolve the error?</p>
  
  <p>Thank you</p>