To return the message sent in the view to laravel, you must follow the procedure below.
@if($message = Session::get('message')){
<div class="alert alert-success">
<p>{{$message}}</p>
</div>
}
the session receives the message that you submitted to the view and displaying it on the corresponding page.
for me, if I need to pass a message to a view, I usually do it this way
return redirect()->route('/project')->with('message', 'project successfully created');
source
share