【发布时间】:2020-06-30 12:19:18
【问题描述】:
我的注册页面正在正确显示表单,其中包含 CsrfToken ({{ csrf_field() }})。
<form method="post" action="{{route('products.store')}}">
{{csrf_field()}}
{{ method_field('post') }}
<div class="form-group">
<label for="exampleName">Name</label>
<input type="text" class="form-control" name="name" id="exampleName" placeholder="Enter Name" aria-describedby="emailHelp">
</div>
<div class="form-group">
<label for="exampleDescription">Description</label>
<input type="text" class="form-control" name="desc" id="exampleDescription" placeholder="Enter Name" aria-describedby="emailHelp">
</div>
<div class="form-group">
<label for="exampleWeight">Weight</label>
<input type="text" class="form-control" name="weight" id="exampleWeight" aria-describedby="emailHelp">
</div>
<div class="form-group">
<label for="examplePrice">Price</label>
<input type="text" class="form-control" name="price" id="examplePrice" aria-describedby="emailHelp">
</div>
<button type="submit" class="btn btn-success">Submit</button>
</form>
当我提交表单时(也刚刚重新加载),它给出了由于错误 419 导致页面已过期。请刷新并重试。错误。
我很努力但无法解决
请帮助我,非常感谢
【问题讨论】:
-
尝试
@csrf而不是csrf_field然后清除缓存.. -
我正在尝试清除 php artisan route:cache ,php artisan config:cache,php artisan route:cache, php artisan view:clear 但不解决 @Sehdev
标签: laravel