php - Laravel 4: Garbage value in URL after Redirect -
php - Laravel 4: Garbage value in URL after Redirect -
i passing parameter via redirect , getting garbage value in url.
example: localhost/feeds/%7busername%7d
garbage value: %7busername%7d
::route::
route::get('feeds/{username}', array('before' => 'auth', 'as' => 'feeds', 'uses' => 'feedscontroller@getfeedspage'));
::controller::
<?php class feedscontroller extends basecontroller { public function getfeedspage($username) { homecoming view::make('feeds.index') ->with('username', $username); } }
::redirect::
$username = user::where('id', '=', $id)->pluck('username'); // returns username (eg. john.doe) - checked homecoming redirect::route('feeds') ->with('username', $username);
issue: instead of passing john.doe, i'm getting %7busername%7d
change
homecoming redirect::route('feeds') ->with('username', $username);
to
return redirect::route('feeds', $username);
php redirect laravel laravel-routing
Comments
Post a Comment