Hi Friend's need help how to display success message in laravel 5.1, I have applied it is working but twice display what is the reason . this is my layout.balde.php code
@if (session()->has('success'))
<div class="alert-success" id="popup_notification">
<strong>{!! trans('main.message') !!}</strong>{{ session('success') }}
</div>
@endif this is my controller page code:
return Redirect::route($this->cdroute, array($customer_id))->with('success',trans($this->updatemsg));
Try this:
//in controller
return Redirect::route($this->cdroute, array($customer_id))->with('success',trans($this->updatemsg));
//in blade template
@if (session('success'))
<div class="alert alert-success">
{{ session('success') }}
</div>
@endif
Try this:
Controller page code:
Session::flash('success',trans($this->updatemsg));
Redirect::route($this->cdroute, array($customer_id));
layout.balde.php code
@if ( Session::has('success') )
<div class="alert-success" id="popup_notification">
{{ Session::get('success') }}
</div>
@endif
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.