How to register a variable to be used in all views?

I have an object that controls the user’s session and grants viewing permissions or not depending on the user role.

So I need to be able to access this object from many views.

I want to do it elegantly (and not ugly).

Searching, I found a post that talks about this same thing (Global Variables with Sage 9 & Blade), but I can’t understand how and where to set these variables.

See Composers | Sage Docs | Roots

You can use * to bind the composer to all views

3 Likes