I would like to be able to accept either a 40-character string ID /users/{id}
or the user's username /users/{username}
and then return the users.show
view.
I have found another solution to this. I don't know which is better though. Hopefully the community can vote...
Within my UsersController.php I have:
public function show($id_or_username)
{
$user = User::where('id' , '=', $id_or_username)->orWhere('username', $id_or_username)->firstOrFail();
return View::make('users.show', compact('user'));
}