就是我設定一個路由,這個路由要進行跳轉,而跳轉是指定某個路由的名稱,就是轉到它那裡
具體程式碼如下:
Route::get('/todo/{name}', 'TodoController@index')->name("todo_name");
Route::get('/todo/foo/{name}', function ($name) {
return redirect()->route('todo_name', $name); //跳轉指定名稱的路由
});
也就是當/todo/foo/{name},執行時,會跳轉至todo_name這個路由
想對外分享這則貼文嗎?運用網址更方便呦~