【发布时间】:2016-05-16 17:57:01
【问题描述】:
我为我的网站创建了一个简单的 PUT 表单(我还有 GET 和 POST 表单,它们都可以正常工作)。
<h1>Edit {!! $brands->brand_name !!}</h1>
<!-- if there are creation errors, they will show here -->
{!! Html::ul($errors->all()) !!}
{!! Form::model($brands, array('route' => array('brands.update', $brands->id), 'method' => 'PUT', 'files' => true)) !!}
<div class="form-group">
{!! Form::label('brand_name', 'Name') !!}
{!! Form::text('brand_name', null, array('class' => 'form-control')) !!}
</div>
<div class="form-group">
{!! Form::label('brand_name_rus', 'Name_rus') !!}
{!! Form::text('brand_name_rus', Input::old('brand_name_rus'), array('class' => 'form-control')) !!}
</div>
<div class="form-group">
{!! Form::label('Your image') !!}
<img src="http://parasha.dev/{{ $brands->img_brand_path }}"/>
</div>
<div class="form-group">
{!! Form::label('img_brand_path', 'New image') !!}
{!! Form::file('img_brand_path') !!}
</div>
{!! Form::submit('Edit the Brand!', array('class' => 'btn btn-primary')) !!}
{!! Form::close() !!}
我还使用 Clip Two Theme 作为包含这些表单的管理面板的布局。当我同时使用两者时(布局和我的表单,它给了我一个错误-> VerifyCsrfToken.php 中的 TokenMismatchException)。所以这个引导主题不知何故会导致该错误。
所以我有两个问题。首先,我该如何解决这个问题。第二,我可以在没有令牌自动创建的情况下创建 laravel 表单吗?对不起我的英语)
【问题讨论】:
标签: forms twitter-bootstrap laravel token mismatch