Laravel: how to pass data from controller into multiple views? – AppServiceProvider

ery quickly, you’ll encounter the situation when multiple views require the same piece of data. For example, if a sidebar widget requires a particular variable for every single page, well we can’t be expected to pass that data from every single controller. No, instead, we can leverage view composers.

B logbook : PHP | Javascript | Laravel | CodeIgniter | VueJs | ReactJs | WordPress