I'm building a site that has to display data collected from an external web service. This service provides multiple data endpoints that are all authenticated against via OAuth.
Rather than each view having to hit an internal method to generate this data (and login to the external service each time) it seems like it'd be much better to create a singleton that will (lazy) connect to the data provider service when a view needing the data is first loaded, and then the various methods supporting the views could just call this same service provider to get the data.
Would this be best in the Laravel world as a service provider? As a helper class with a singleton? Or some other way?