I have profile form with fields, that use should fill.
After submit button I do redirect to another controller(page).
How can I show message there only once? I mean that if user will update again profile, message will not showen more.
Try this, it will only show message one time:
if($user_update) {
if(Session::has('update_profile_message') {
return redirect()->back(); //or wherever you want to redirect
} else {
return redirect()->back()->with('update_profile_message', 'Your profile has been updated successfully.');
}
}