I have created an app. I need to add a slider from the App\Slider
class to the default app layout view. Which is the most efficient way to do this without having to change my controller logic for each controller?
Is there a way I can add the class and function to the Controller
, BaseController
, Service Inject
an instance of the App\Slider
or use and create a ViewComposer
. Currently I am stuck on which way would be most efficient as technically I only need to add a foreach loop to the layouts.app
.
The controller method is already built.