Support the ongoing development of Laravel.io →
posted 9 years ago
Requests
Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

Are you using a return?

return Redirect::to($app->slug);

And a null value actually sends me to the / path

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Jafo232 jafo232 Joined 6 Aug 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.