Can we have multiple servers running our Laravel application across regions of the world, and still store our files “locally” with Laravel’s ‘Local’ storage driver?
Good news, because yes, we can! We no longer have to rely on external storage services to host our files for us. Instead, we’ll just have to “talk” to the right server/instance running our application.
In my latest blog post we drop in a quick call to Fly.io’s fly-replay response header in order to easily talk to the instance containing a specific PDF file. Afterwards, we make use of Livewire’s wire:init directive to allow our page to complete loading first before loading a PDF file to view.