0
私はclass="table table-hover"
テーブルを持っており、クリック可能にしようとしています。表は、ユーザーID、名前、およびその他の属性で構成されています。私の最初の試みは、行全体をクリック可能にすることでしたが、時間がかかり、私はそうすることができませんでした。 フォームまたはHTMLを使用してテーブルにルートを追加する
@foreach($user as $users)
<tbody>
<tr>
<td> {{link_to('home', $title = $users->id)}} </td>
<td>{{$users->name}}</td>
<td>{{$users->phone}}</td>
<td>{{$users->city}}</td>
<td>{{$users->street}}</td>
<td>{{$users->national_id}}</td>
@endforeach
そして、これは私の質問は、私はそれがにGETメソッドである必要があり、IDのクリッカブルを作ることができる方法である私のルート
Auth::routes();
Route::group(['middleware'=>'auth'],function() {
Route::get('/home', '[email protected]');
Route::Resource('/user', 'UserController');
});
Route::get('/admin', '[email protected]');
です:今、私はこのコードによってユーザーIDのクリッカブルを作ることにしましたSHOW機能(public function show($id)
)。その中にアンカーが好き含まTDを作るuser/1
申し訳ありませんあなたが私に言ったことを試しましたが、URLは 'http:// localhost:8000/user/4'の代わりに' http:// localhost:8000/user4'を返します@Mayank Pandeyz – leo0019
私は少し作ったchange href = "{{url( '/ show詳細 ')。'/'。$ users-> id}} " –