inertia-laravel icon indicating copy to clipboard operation
inertia-laravel copied to clipboard

Allow Inertia\Response rebinding in user-land

Open pyrou opened this issue 2 years ago • 0 comments

For some specific use case, I would be able to override the Inertia\Response class to add some project-specific helpers, that can't be achievable with Inertia::shared().

Switching from new Response to app()->make(Response::class) in ResponseFactory would let us (as project user) rebind the Response class in a Service provider :

$this->app->bind(\Inertia\Response::class, CustomInertiaResponse::class);

This PR doesn't introduce breaking changes.

pyrou avatar Oct 27 '22 10:10 pyrou