You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now when you call the og_image() helper function it returns a Image class that extends Illuminate\Http\Response and sets it up so that way Laravel will get an image file response to return back to the browser.
This class also has a __call() method on it to proxy any additional methods off to the Base64EncodedImage class that extends the Illuminate\Http\UploadedFile class and restores the base64 encoded image from Chrome as a temporary file so that you can use all the file manipulation stuff you're used to from uploading files in Laravel.
Both those are great currently.. But while working on my own projects I realized that originally I wanted the ability to have more control over my OG image generation, which is why those two abilities exist. But now I'm becoming to really come around to just using the /og-image url for everything...
But that don't work in the current state because it generates the screenshot and that slows the request down immensely and no bueno.
So we'll re-architect it in a way that if you return from a route handler/controller Laravel gets a responsable interface implemented so that it can handle that use case correctly, which would also execute Chrome under the hood to generate the image.
It would also implement a uploaded file interface so you get all those goodies still too.
But if executed in the context above, like in a blade template, where it'll get called to be transformed into a string, then in that case we just the /og-image route with the query string passed through, so you'd end up getting the string
Right now when you call the
og_image()
helper function it returns aImage
class that extendsIlluminate\Http\Response
and sets it up so that way Laravel will get an image file response to return back to the browser.This class also has a
__call()
method on it to proxy any additional methods off to theBase64EncodedImage
class that extends theIlluminate\Http\UploadedFile
class and restores the base64 encoded image from Chrome as a temporary file so that you can use all the file manipulation stuff you're used to from uploading files in Laravel.Both those are great currently.. But while working on my own projects I realized that originally I wanted the ability to have more control over my OG image generation, which is why those two abilities exist. But now I'm becoming to really come around to just using the
/og-image
url for everything...So I thought, why not just do
But that don't work in the current state because it generates the screenshot and that slows the request down immensely and no bueno.
So we'll re-architect it in a way that if you return from a route handler/controller Laravel gets a responsable interface implemented so that it can handle that use case correctly, which would also execute Chrome under the hood to generate the image.
It would also implement a uploaded file interface so you get all those goodies still too.
But if executed in the context above, like in a blade template, where it'll get called to be transformed into a string, then in that case we just the
/og-image
route with the query string passed through, so you'd end up getting the stringThus making all of these use cases work!
The text was updated successfully, but these errors were encountered: