I have a action like the following in my controller (home)
public function action_test($keyword)
{
echo $keyword;
}
it works fine when i pass parameter without space like the following
http://localhost/laravel/home/test/apple
but it gives 404 error when i pass argument with space like the following
http://localhost/laravel/home/test/green apple
it does not even works when the space is encoded
http://localhost/shop/public/home/test/green+apple
not even this
http://localhost/shop/public/home/test/green%20apple
can anybody please help me in this
Register your route with (:all) instead of (:any).
From the Laravel docs:
Your route could then look something like this:
Route::get('home/test/(:all?)', 'home@test');
More on that topic in the Laravel forum here.