@dogakorkmaz35 I think its
use Illuminate\Support\Facades\View;
View::getShared();
Hi there, in one of my projects I am trying to differentiate current laravel application's view shared data vs data that passed down as props to view file via view("file")->with($data);, I tried to create a ViewFactory class that extends and overrides Laravel's default Illuminate\View\Factory class, and returns (via its viewInstance method) my own View class that extends Illuminate\View\View, and implement my own gatherData method in that View class, I can successfully gather all the globally shared data that is registered via Illuminate\View\Factory::share(...) calls, I cant find a proper way to separate $props that is passed by controller and variables which are registered via Illuminate\View\Factory::composer(...) nor Illuminate\View\Factory::creator(...), even in constructors of these files passed $data array seems to be populated by these calls already. If anyone knows or has any slight idea how can I intercept Laravel's global variable (I know composer and creator calls may not be registering a global variable, it can be file specific, but still, not controller passed) lifecycle so at the end of the whole pipeline I can create a separated variable scope I would appreciate it a lot! Thanks in advance for any response.
Laravel version: ^13.8
Please or to participate in this conversation.