出现“BadMethodCallException 方法 App\Http\Controllers\StoreController::show 不存在。”的错误,意味着在StoreController控制器类中缺少了show方法。以下是解决此问题的步骤:
public function show($id)
{
// 执行相关操作
}
Route::get('/store/{id}', 'StoreController@show')
,则show方法应该接受$id参数。composer dump-autoload
命令以确保自动加载文件已更新。通过检查上述步骤,您应该能够解决“BadMethodCallException 方法 App\Http\Controllers\StoreController::show 不存在。”的问题。