我有三個URL:laravel routes.php文件動態URL
localhost:8000/oc/online-marketing/ppc
localhost:8000/websystems/online-marketing/ppc
localhost:8000/all/online-marketing/ppc
,我需要爲每個URL動態設置。
在此之前,我曾經有過這樣的route.php:
Route::get('oc/online-marketing/ppc', function()
{
$users = User::where('client_id', 1)->get();
return View::make('users')->with('users', $users);
});
但我必須設置動態URL是這樣的:Route::get('{project}/{module}/{submodule}', ...);
其中project
是oc
或websystems
或全部
module
是online-marketing
submodule
是ppc
項目名稱oc
,websystems
或all
可以在表名爲users
我怎樣才能做到這一點通過使用控制器?