I want route like:
Route::get('/{slug}/{slug-2}/{slug-3}/../{slug-n}', ['as' => 'slug', 'uses' => 'SlugController@slug']);
How to define this with laravel is it even possible ?
I want route like:
Route::get('/{slug}/{slug-2}/{slug-3}/../{slug-n}', ['as' => 'slug', 'uses' => 'SlugController@slug']);
How to define this with laravel is it even possible ?
Possibly
Route::get('{slug}/{slugNum?}', 'SlugController@slug')->where('slugNum', '(.*)');
And in your controller you will need to just seperate the slugNum into an array (explode)
public function getPage($slug, $slugNum = null)
{
if($slugNum)
{
$slugNum = explode('/', $slugNum);
// all your slugs here.. to play with
}
}
I know this will work on 4!