Shirts의 데이터를 세부 정보로 전달하고 제품의 세부 정보를 알고 싶습니다. 셔츠. 그렇게하는 방법? 여기 Error's Message"유형 오류 : App Http Controllers FrontController :: detail() 함수의 인수가 너무 적습니다. 0이 전달되고 정확히 1이 필요합니다."
일부 오류이 내 웹보기를 web View
FrontController.php
class FrontController extends Controller
{
public function index()
{
$shirts=Product::all();
return view('front.home', compact('shirts'));
}
public function shirts()
{
$shirts=Product::all();
return view('front.shirts', compact('shirts'));
}
public function detail($id)
{
return view('front.shirt', ['detail' => Product::findOrFail($id)]);
}
경로 Web.php
Route::get('/', '[email protected]')->name('home');
Route::get('/shirts', '[email protected]')->name('shirts');
Route::get('/detail', '[email protected]')->name('detail');
Shirts.blade.php
난 당신이 또한 ID 매개 변수를 줄 필요가 경로에서 생각 (210)<a href="{{route('detail', $shirt->id)}}">
댓글이 확장 된 논의하지 않습니다; 이 대화는 [채팅으로 이동되었습니다] (http://chat.stackoverflow.com/rooms/161966/discussion-on-question-by-yudha-patria-type-error-to-few-arguments-to-functio) . –