如果說我的GET、POST都要指定在同一個Controller,那要如何做呢?
可以採用這個方式
Route::match(['get', 'post'], '/', function () {
//
});
第1個參數是陣列,放get,post,delete之類的
第2個參數是路徑,例如/,/category,/post等
第3個參數可以接直接function(),也可以直接接到controller,就像這樣「TodoController@add」
想對外分享這則貼文嗎?運用網址更方便呦~