pickab00
302
16
Laravel

Can not use variable outside of If statement

Posted 3 months ago by pickab00

My variable can not be used outside of the if statement. Here is my controller:

public function getStuff(){

    if ($insert->free_meal == 1){
                $push = 'Guest is also eligible for a Free Meal';
        }

    return $push;   

}

It is giving me variable not found

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