Closed bradlc closed 6 years ago
After chatting to @sambeevors I realised that you can already do this with View::share
The difference is that stuff shared with View::share
is not attached to window
/global
, it is passed in to your root component as a prop (which is potentially better to be fair)
Props are now available on window.Laravel
You can currently add globals in the config file, but this doesn’t work for dynamic values as the config is cached by Laravel.
We should add a method which can be used to define global JS variables at runtime: