在Laravel中缺少App \ Http \ Controllers \ ProjectCollaboratorsController :: deleteOneCollaborator()的参数2

时间:2017-12-24 08:42:53

标签: php mysql laravel-5 model

需要从协作者表中删除项目协作者。这是collaboratorController删除方法

public function deleteOneCollaborator($projectId, $collaboratorId) //this is line 112
    {
        Collaboration::where('project_id', $projectId)
                    ->where('collaborator_id', $collaboratorId)
                    ->delete();

        return redirect()->back()->with('info', 'Collaborator deleted successfully');
    }

和路线

Route::get('projects/{projects}/collaborators/delete', [
    'uses' => 'ProjectCollaboratorsController@deleteOneCollaborator',
]);

删除刀片文件链接

<a href="/projects/{{ $project->id }}/collaborators/delete" class="editInline" onclick="return confirm('Are you sure to want to delete this Collaborator?')"><i clas
                      s="glyphicon glyphicon-trash"></i>Delete</a>

但是得到了这个错误代码?

ErrorException in ProjectCollaboratorsController.php line 112: Missing argument 2 for App\Http\Controllers\ProjectCollaboratorsController::deleteOneCollaborator() 

如何解决这个问题?

0 个答案:

没有答案