質問編集履歴

1

①、②でpathを分けることを実現させたい

2018/08/29 01:03

投稿

kkkenn
kkkenn

スコア8

test CHANGED
File without changes
test CHANGED
@@ -64,6 +64,20 @@
64
64
 
65
65
 
66
66
 
67
+ ①だけを通すためなら
68
+
69
+ Route::get('/{user}/{repo}/{branch}/{path}','SearchController@show')->where('path','.*');
70
+
71
+ Route::get('/{user}/{repo}/{branch}/{path?}','SearchController@show');
72
+
73
+ とすればbranch以下のpathに何が来ても(user/repo/branchのような場合でも)通るようになりますが、
74
+
75
+ @@@@.@@@のpathが来た時もshowアクションが動くようになってしまいます。
76
+
77
+ @@@@.@@@の場合は違うアクションを動かしたいです。
78
+
79
+
80
+
67
81
 
68
82
 
69
83
  Route::get('/{user}/{repo}/{branch}/{path}','SearchController@show')->where('path','*.*');