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路由:列表的输出
查看下面的答案我忘记插入存储库:))