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

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -