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 405方法不允许重定向错误laravel为什么_Php_Laravel - Fatal编程技术网

Php 405方法不允许重定向错误laravel为什么

Php 405方法不允许重定向错误laravel为什么,php,laravel,Php,Laravel,我的删除功能如下: Route::resource('/reference/attribute','nez\attribute\SeiAttributeController',['names'=>'attribute']); public function index() { return View::make($this->view_path.'.index'); } 伙计们,在我添加这一行之前请帮帮我return Redirect::route('attribute.

我的删除功能如下:

Route::resource('/reference/attribute','nez\attribute\SeiAttributeController',['names'=>'attribute']);
public function index()
{
    return View::make($this->view_path.'.index');
}
伙计们,在我添加这一行之前请帮帮我
return Redirect::route('attribute.index')

我没有错误,但在我犯了这个错误之后

405方法不允许

我的路线是这样的:

Route::resource('/reference/attribute','nez\attribute\SeiAttributeController',['names'=>'attribute']);
public function index()
{
    return View::make($this->view_path.'.index');
}
我的控制器索引如下所示:

Route::resource('/reference/attribute','nez\attribute\SeiAttributeController',['names'=>'attribute']);
public function index()
{
    return View::make($this->view_path.'.index');
}

这似乎有问题:

  $this->capacity->update($input['capid'], $input);
$this->capacity
在哪里解决?您确定属性总是在方法中的这一点设置吗

update方法通常采用单个参数,即具有新值的键数组

如果您已正确地将$this->capacity解析为要更新的记录,则最好使用以下内容:

$this->capacity->update([
    'field_1' => Arr::get($input, 'field_1'),
    'field_2' => Arr::get($input, 'field_2'),
     //...etc
]);

methodNotAllowed异常表示您请求的HTTP方法不存在路由。请检查您的路由-php artisan路由:列表请共享
php artisan路由:列表的输出
查看下面的答案我忘记插入存储库:))