简体   繁体   English

Laravel 5在RouteCollection.php第219行中的MethodNotAllowedHttpException:

[英]Laravel 5 MethodNotAllowedHttpException in RouteCollection.php line 219:

While working with forms on my laravel project I keep getting this error I don't understand why. 在laravel项目上使用表单时,我不断收到此错误,但我不明白为什么。

It's an issue with my routes file as far as I understand it: 据我了解,这是我的路线文件的问题:

Route::post('postsmth', ['uses' => 'adminPageController@postsmth', 'as' => 'postsmth']);

Blade view: 刀片视图:

<form action="{{ route('postsmth') }}" method="post">
                <div class="input-group">
                    <span class="input-group-addon">Select from the list</span>
                    <select class="form-control" name="select1" id="select1">

                        <?php 
                        for ($x = 0; $x <= 10; $x++) {
                          echo "<option value='$x'>".$x."</option>";
                        } 
                        ?>

                    </select>
                </div>
                <div class="input-group">
                    <span class="input-group-addon">Department ID</span>
                    <select class="form-control" name="select2" id="select2">
                      <?php 
                        for ($y = 10; $y <= 20; $x++) {
                          echo "<option value='$y'>".$y."</option>";
                        } 
                        ?>

                    </select>
                </div>
    <button type="submit">Submit</button>
    <input type="hidden" value="{{ Session::token() }}" name="_token">
</form>

Controller: 控制器:

public function postmaps(Request $request) {


}

As stated in the comments it's as simple as that: 如评论中所述,就这么简单:

postmaps != postsmth postmaps!= postsmth

public function postsmth(Request $request) {


}

solves it 解决它

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 RouteCollection.php 第 219 行中的 Laravel 5 MethodNotAllowedHttpException - Laravel 5 MethodNotAllowedHttpException in RouteCollection.php line 219 Laravel 5:RouteCollection.php第219行中的MethodNotAllowedHttpException - Laravel 5: MethodNotAllowedHttpException in RouteCollection.php line 219 Laravel API 中 RouteCollection.php 第 219 行中的 MethodNotAllowedHttpException - MethodNotAllowedHttpException in RouteCollection.php line 219 in laravel API's Laravel 5.2:RouteCollection.php 第 219 行中的 MethodNotAllowedHttpException - Laravel 5.2 : MethodNotAllowedHttpException in RouteCollection.php line 219 Laravel 错误:RouteCollection.php 第 219 行中的 MethodNotAllowedHttpException - Laravel error: MethodNotAllowedHttpException in RouteCollection.php line 219 在Laravel中在RouteCollection.php第219行中获取MethodNotAllowedHttpException - Getting MethodNotAllowedHttpException in RouteCollection.php line 219: on laravel 在RouteCollection.php第219行中的Laravel 5.2 MethodNotAllowedHttpException - Laravel 5.2 MethodNotAllowedHttpException in RouteCollection.php line 219 RouteCollection.php 219行中的MethodNotAllowedHttpException错误laravel: - MethodNotAllowedHttpException in RouteCollection.php line 219 error laravel: Laravel 5.1.26:RouteCollection.php第219行中的MethodNotAllowedHttpException - Laravel 5.1.26 : MethodNotAllowedHttpException in RouteCollection.php line 219 RouteCollection.php第219行中的MethodNotAllowedHttpException - MethodNotAllowedHttpException in RouteCollection.php line 219
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM