Route with out parameter works fine, but with parameter view is not working properly in Laravel 5 -
routes.php
route::get('/viewprofile/{uid?}','usercontroller@viewprofile');
usercontroller.php
public function viewprofile($uid){ if ($uid <> null) { $getuser = user::where('id','=',$uid)->first(); return view('user.profile')->with('getuser',$getuser); } }
inbox.blade.php
<a href="{{ url::to('viewprofile',[$msg->user->id]) }}"> {{$msg->user->username }} </a>
when use route parameter profile.blade.php page design collapses, when use simple route route::get('/viewprofile','usercontroller@viewprofile');
it works fine. need help! in advance.
Comments
Post a Comment