Mego
2 months ago
199
3
General

Condition make the operation after if() but returns false

Posted 2 months ago by Mego

Hi guys, I have a condition like this

if(Mail::to('[email protected]')->send(new BugReport($validatedData))) {
                flash('Hlásenie o chybe bolo úspešne odoslané.Ďakujeme')->success();
            } else {
                flash('Chyba! Hlásenie o chybe sa nepodarilo odoslať. Skúste znova neskôr')->error();
            }
            return view('bug');

So I am checking, if e-mail was sucesfully sent, if yes, I am setting the success flash message, if not, I am setting error flash message. The problem here is, that I receive the e-mail, but I get error flash message. Why?

Please sign in or create an account to participate in this conversation.