I have this form to create a new article. User inputs everything correctly but i get a return of TokenMismatchException in VerifyCsrfToken.php line 53:
. I saw another post saying that because i used the open form Tag it will already add this for me and to take it out. How do i take this out? or is there some other problem that im overlooking?
here is my controller
public function store( AddArticleController $request)
{
$request= $request->all();
$request['user_id']=Auth::id();
Article::create($request->all());
return redirect('/user');
}
and here is the html
<form class="form-horizontal" role="form" method="POST" action="{{ url('/article/add') }}">
{!! Form::open(
array(
'class' => 'form',
'novalidate' => 'novalidate',
'files' => true)) !!}
<div class = "form-group">
{!! Form::label('title','Title:', ['class' => 'col-md-4 control-label']) !!}
<div class="col-md-6">
{!! Form::text('title',null, ['class' => 'form-control']), !!}
</div>
</div>
<div class = "form-group">
{!! Form::label('title','Image:', ['class' => 'col-md-4 control-label']) !!}
<div class="col-md-6">
{!! Form::file('image') !!}
</div>
</div>
<div class="form-group">
{!! Form::label('title','Type:', ['class' => 'col-md-4 control-label']) !!}
<div class="col-lg-1">
{!! Form::select('type', array('select' => 'select','fashion' => 'Fashion', 'music' => 'Music', 'dance' => 'Dance', 'event' => 'Event'))!!}
</div>
</div>
<div class = "form-group">
{!! Form::label('body','Comment:', ['class' => 'col-md-4 control-label']) !!}
<div class="col-md-6">
{!! Form::textarea('body',null, ['class' => 'form-control']) !!}
</div>
</div>
<div class = "form-group">
{!! Form::label('body',' ', ['class' => 'col-md-4 control-label']) !!}
<div class="col-md-6">
{!! Form:: submit('Sumbit', ['class' => 'btn btn-primary form-control']) !!}
</div>
</div>
{!! Form::close() !!}
</form>