1 year ago

Custom Blade Provider variable condition

Posted 1 year ago by nam_co

Hi, hope somebody can help me, Im looking for a way to check if a variable exist in the blade and if the user login, currently I have this but it doesn't work

        \Blade::if('account', function () {
            return auth()->check() && isset($account) == TRUE;

I know I can do @account($account) but the idea is that $account is not always available, how can I use this?

Hope somebody can help me, thanks

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