I ran couple tests here and this style of dynamic route worked for me.
Couple other things, would be to confirm the $app data is making valid routes. You can check the routes that are generated with artisan,
php artisan routes
or you could just dump the route url and make sure it is loading the right one, but artisan is more in-depth
var_dump( URL::route($app->slug) ) ;
Only other thing I can think of is if the $app->slug is returning null for some reason then the Redirect::to(...) would be ignored. I would be to make sure that you can access the $app->slug in the controller and it is returning the expected value.
Hope that helps.
Thanks.
Artisan returned:
| Domain | URI | Name | Action | Before Filters | After Filters |
| | GET|HEAD|POST|PUT|PATCH|DELETE vb3 | vb3 | Vb3Controller@router | Sentinel, inRole | |
When I go to the url /vb3 it works.
I echo'd the slug in the area I am trying to do the redirect in, and it returns vb3.. No error.. Still tinkering. I am wondering if there perhaps is some output that is stopping the redirect.. That is what I will be checking next.
Are you using a return?
return Redirect::to($app->slug);
And a null value actually sends me to the / path
Are you using a return?
Ugh.... Now I feel like an idiot. Too many hours in front of the monitor, I guess I can't see. Thank you. It is working now.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community