我想可选的参数添加到我家的路线是可选参数,基本路线添加在Laravel
Route::get('/{selectDate?}', [
"as" => "/",
"uses" => "[email protected]"
]);
和我的索引功能就像
public function index($date = null)
{
if($date!=null){
//some line of codes
}
}
和我引发的可选参数在切换功能的选择列表是
$(function() {
$('#selectDate').on('change', function() {
window.location.href = '{{route("/")}}' + "/" + this.value;
});
});
现在的问题是这样的,当我打任何其他链接从主页他们都在索引功能不在自己的书面功能。 需要有关此问题的帮助。
请告诉我们你的'路径/文件web.php' – Sebastian
@Sebastian'路线/ web.php'已经第一块 –
上公布@MayankPandeyz这是只有一个路由。我想看到整个文件。 – Sebastian