0
我正在嘗試通過id進行搜索。laravel路由和參數
<form method="post" action="{{action('[email protected]')}}">
<input type="text" name="id">
控制器
public function edit(Request $request)
{
$id=$request->id;
$ply = Player::find($id);
return view::make('player.edit')->with(compact('ply'));
}
路線
Route::get('/player/edit/{id}', '[email protected]');
edit.blade.php
<td>{{$ply[first_name]}}</td>
我越來越不確定的變量FIRST_NAME錯誤。
@ KenGraham.if其有用的標記答案被接受。 – iCoders
@ KenGraham.glade在這裏它幫助你 – iCoders