How to Redirect Url in following format:
My code:
return Redirect::to('home/viewcustomer/$cusid')
->with('status','success')
->with('message','success');
Example :
home/viewcustomer/8
You need to take care about your string quotes while using variables within string quotes. Just update your code
Redirect::to('home/viewcustomer/$cusid')
into
Redirect::to("home/viewcustomer/$cusid")
^^ ^^
Well i usually use
Session and Redirect so you have to define it in your controller
Use Session;
Use Redirect;
Then
public function example(){
Session::flash('status','Your message');
return Redirect::to('/yourRoute');
}
If you want to show your message in your view you have to do this...
@if(Session::has('status'))
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<p><strong>Success!!</strong> </p>
<ul>
<li>{{ Session::get('status') }}</li>
</ul>
</div>
@endif
Hope this helps!!
Ps: Sorry for the bad english :)
Redirect::to('home/viewcustomer/'.$cusid)