Boubou
1 month ago
176
3
Laravel

How to keep passing the same data to navbar on blade without repeating it?

Posted 1 month ago by Boubou

Hi All,

Let's say you have a navbar and each time you wish to have the user email showing up. At the moment when I click on different page, I always add a user construct to each controller and repass the same data again and again to each view, I find this not right to keep repeating myself.

What is the best way to pass the same data to blade on a navbar without each time repeating a construct please?

I am sure there must be some kind of of a global file where I can add initiate my eloquent request from.

Thanks!

Please sign in or create an account to participate in this conversation.