Laravel-View-Composer-to-share-data-in-partial-views

Use Laravel View Composer to share data in partial views

Ever been in a situation where you have to share some data with multiple views? I have. If you are passing it in every controller pretty soon it will get very messy since you end up duplicating same code in multiple controllers which is against the DRY principle. Let’s learn about view composer provider by Laravel which eliminate this issue and gives you a single place to attach your logic for view data. Continue reading…