Hi, I’m migrating an app away from SlimPHP to Laravel (sorry!)
I’ve been following the approach described here: https://tighten.com/insights/converting-a-legacy-app-to-laravel/
The SlimPHP app is wrapped by Laravel to allow gradual migration. Laravel forwards any request not matching a Laravel route on to the SlimPHP code, and uses output buffering to capture the reponse.
public function __invoke()
{
ob_start();
require app_path('Http') . '/legacy.php';
$output = ob_get_clean();
return new Response($output);
}
But this ignores things like response headers, status codes etc.
Since the SlimPHP route is returning a PSR-7 Response it feels I ought to be able to capture the headers, status codes and status text somehow at least, if not just directly return the response object itself.
If anyone has any ideas on this I’d really appreciate any suggestions. Thanks.