1
私は以下のようなURL構造を実現しようとしています。 LaravelルートURL - クエリ文字列 - マルチレベル
にエラーが発生しました[ルートのために必要なパラメータが含まれていません
- example.com/clients/{client_id} // :clients.show_project] [URI:clients/{client}/{project_id}]。ビュー
<a href="{{ route('clients.show_project', $task->client_id, $task->project_id)}}">{{ $task->title }}</a>
で
Route::group(['prefix' => 'clients', 'as' => 'clients.'], function() { Route::get('/', [ 'uses' => '[email protected]', 'as' => 'index', ]); Route::get('/create', [ 'uses' => '[email protected]', 'as' => 'create', ]); Route::post('/store', [ 'uses' => '[email protected]', 'as' => 'store', ]); Route::group(['prefix' => '{client}', '__rp' => ['menu' => 'clients']], function() { Route::get('/', [ 'uses' => '[email protected]_client', 'as' => 'show', ]); }); Route::group(['prefix' => '{client}/{project_id}'], function() { Route::get('/', [ 'uses' => 'Cl[email protected]_project', 'as' => 'show_project', ]); }); });
コントローラ
public function show_project($client, $project_id) { $project_threads = Project_Threads::where('project_id', $project_id)->get(); return $project_threads; }
は、あなたが私のコード更新 –
show_project' 'ClientsController @のコードを入れることができます@ Bara'ayyash。 – Zack