Support the ongoing development of Laravel.io →
posted 7 years ago
Forms
Last updated 1 year ago.
0

Hi Bimal, in order to work your form, you need to add hidden field to your form like: "<input type="hidden" name="_token" value="{{ Session::token() }}"> "

this is my login form sample:

<div class="col-md-6">
      <h3>Sign In</h3>
      <form action="{{ route('signin') }}" method="post">
        <div class="form-group {{ $errors->has('email')?'has-error':'' }}">
          <label for="email">Your E-Mail</label>
          <input class="form-control" type="text" name="email" id="email" value="{{ Request::old('email') }}">
        </div>
      
    <div class="form-group {{ $errors->has('password')?'has-error':'' }}">
      <label for="password">Your Password</label>
      <input class="form-control" type="password" name="password" id="password" value="{{ Request::old('password') }}">
    </div>

    <button type="submit" class="btn btn-primary">Submit</button>
    <input type="hidden" name="_token" value="{{ Session::token() }}">    
  </form>
    
</div>
Last updated 7 years ago.
0

What version of laravel are you using?

HAVE you registered the HTML facade in your config/app.php file?

Also, make sure you have "illuminate/html" in your composer.json file as this was removed from the laravel core in recent updates.

Last updated 7 years ago.
0

ukashka said:

Hi Bimal, in order to work your form, you need to add hidden field to your form like: "<input type="hidden" name="_token" value="{{ Session::token() }}"> "

this is my login form sample:

<div class="col-md-6"> <h3>Sign In</h3> <form action="{{ route('signin') }}" method="post"> <div class="form-group {{ $errors->has('email')?'has-error':'' }}"> <label for="email">Your E-Mail</label> <input class="form-control" type="text" name="email" id="email" value="{{ Request::old('email') }}"> </div>
   <div class="form-group {{ $errors->has('password')?'has-error':'' }}">
     <label for="password">Your Password</label>
     <input class="form-control" type="password" name="password" id="password" value="{{ Request::old('password') }}">
   </div>

   <button type="submit" class="btn btn-primary">Submit</button>
   <input type="hidden" name="_token" value="{{ Session::token() }}">    
 </form>
   
</div>
0

thanks very much it helps me a lot

0

Sign in to participate in this thread!

Eventy

Your banner here too?

bimal125 bimal125 Joined 1 Apr 2017

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.