Best practice for display current user information

Posted 1 month ago by zfdeveloper

I have a page where it will display a listing of plans for the current authenticated user, the question I have is regarding best practice. I have an AdController with an index method that will list every subscriptions an user has. The thing is, in the blade template I could easily do something like @foreach(auth()->user()->subscriptions as $subscription) but I was wondering if it's a good practice or it's better to pass this information from the controller itself.

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

Reply to

Use Markdown with GitHub-flavored code blocks.