Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php laravel-5.6中的MethodNotAllowedHttpException_Php_Laravel_Methods_Routes_Laravel 5.6 - Fatal编程技术网

Php laravel-5.6中的MethodNotAllowedHttpException

Php laravel-5.6中的MethodNotAllowedHttpException,php,laravel,methods,routes,laravel-5.6,Php,Laravel,Methods,Routes,Laravel 5.6,我正在尝试使用方法“POSt”提交表单,但获取MethodNotAllowedHttpException我知道获取此错误的一些可能原因,并在internet上搜索可能的解决方案。我的项目的所有其他形式都很好,除了这个。我没有找到为什么我会犯这种常见错误的原因。有人能帮我找出解决办法吗 形式 AttendanceControl.php 试试这个 Route::post('checkout', 'Admin\HR\AttendanceController@checkout')->name('c

我正在尝试使用方法“POSt”提交表单,但获取
MethodNotAllowedHttpException
我知道获取此错误的一些可能原因,并在internet上搜索可能的解决方案。我的项目的所有其他形式都很好,除了这个。我没有找到为什么我会犯这种常见错误的原因。有人能帮我找出解决办法吗

形式

AttendanceControl.php

试试这个

Route::post('checkout', 'Admin\HR\AttendanceController@checkout')->name('checkout');

<form action="{{ route('admin.checkout') }}" method="POST">
Route::post('checkout','Admin\HR)\AttendanceController@checkout')->name('checkout');

在web.php文件中创建路由

Route::get('/', 'LoginController@index');
在控制器中添加

public function index(){
$postHeader = Request::header();        // HEADER Data
$postData = Request::all();
if(!empty($postData)){

    echo'<pre>';print_r($postData); die;

}       
公共功能索引(){
$postHeader=Request::header();//头数据
$postData=Request::all();
如果(!empty($postData)){
回显“;打印($postData);模具;
}       
}

不要忘记在视图中添加crf令牌


{{csrf_field()}}


向我们展示您的完整路线
web.php
使用php artisan route更新的web.phpTry清除路线缓存:Clear您是否正常单击按钮进行提交,或者是否涉及任何javascript?是,我正常提交。你是否在你的route.php文件中检查了你的所有路线检查你是否有路线
php artisan route:list
Route::post('checkout', 'Admin\HR\AttendanceController@checkout')->name('checkout');

<form action="{{ route('admin.checkout') }}" method="POST">
Route::get('/', 'LoginController@index');
public function index(){
$postHeader = Request::header();        // HEADER Data
$postData = Request::all();
if(!empty($postData)){

    echo'<pre>';print_r($postData); die;

}       
<form name="" action="login" method="POST">