fastsol's avatar

View composer making phpunit tests and page slow

I have found that by simply having a view()->composer() in my service provider it dramatically slows down my phpunit test suite and somewhat slows down my page loads even on pages that the view composer is not being used on.

If I comment out the composer lines, the unit tests go quickly. I have even tried the most basic of composers just make sure it's not the view file or the contents of the callback that is slowing it down and yes the 'test' view does exist.

view()->composer('test', function(){});

I have tried switching the order of the service providers, moving the composer code to a different provider and nothing makes it better other than literally removing/commenting out the composer lines. I'm at a loss. I have the same concept stuff in another app with no issues. Google has gotten me nowhere.

I need your suggestions!

0 likes
0 replies

Please or to participate in this conversation.