mercredi 10 mai 2017

Laravel 5.0 masking routes

I'm new to Laravel world (using 5.0) and I'm learning how to route. I have this route

Route::get('users/{id}', 'UserController@showProfile');

and the UserController

public function showProfile($id) { return view('user.profile', ['user' => User::findOrFail($id)]); }

and everything works fine. The url in my address bar is e.g. localhost:8000/users/1 It is possible to mask this route, having instead something like localhost:8000/users/profile, making the query under the hood? Thank you all



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire