php - Laravel: Unable to echo $message variable after Reirection with $message -
i redirecting using following code
return redirect::to("update/a/product") ->with("message", "product updated");
but when try echo $message
variable inside view, error of undefined variable.
how defining/echoing $message
? since returning redirect flash data, access using session::get(), can check there first session::has()
<?php if (session::has('message')) { $message = session::get('message'); echo $message; } ?>
Comments
Post a Comment