dimanche 27 mars 2016

Post Data not working correctly Laravel

I have a Route as below that will display a profile depending on the data in the url:

Route::get('/{region}/{summonername}', function () {
    return 'Summoner Profile';
});

I have a Form on the Home page which consists of a Input Box and Region Selector. I am posting this data to:

Route::post('/summoner/data');

The problem is that i don't know how i can convert the form data eg. Summoner Name and Region into the url format where the user will be displayed with the profile page and the url would be /{region}/{summonername}. Am i supposed to use a Redirect::to inside my controller? I feel like that is a crappy way of doing it. Any Suggestions?

Right now when i post the data the url displays as '/summoner/data'.

I hope this makes sense, let me know if you need more clarification.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire