Event should be "sideeffect" of your primary action.
So default meaning is, that event should not have direct response.
I think you should rethink your code design.
ANYWAY
You can do that by putting message into session via your event. This is strongly unrecommended (at least by me). But at least, take care of deleting this message from session after usage.
You have your event emitter in try/catch. If try fits in, you will flash message. If it will not fit in, you will throw an error in your listener and catch it. There you can flash another message. Again, I do not recommend even this solution
EXAMPLE
if($type == '-'){
if($balance < $amo)
{
flash()->overlay('Warning!', 'Amount is higher than Balance.', 'warning');
}
else
{
$wallet->users()->updateExistingPivot($uid, ["balance" => ($balance - $amo)]);
throw new \Exception('case1');
}
}else{
$wallet->users()->updateExistingPivot($uid, ["balance" => ($balance + $amo)]);
throw new \Exception('case2');
}
And run it like this:
try {
event(new YourEventEmitter($params));
return view('dashboard')->with('message', 'event is ok');
} catch (\Exception $e) {
if ($e->message === 'case1')
return view('dashboard')->with('message', 'event error 1');
else if ($e->message === 'case2')
return view('dashboard')->with('message', 'event error 2');
}
**I DO NOT RECOMMEND THIS!!! IT IS NON-SENSE. EVENT SHOULD NOT DO ANYTHING WITH YOUR RESPONSE.**