Standalone virtual machine for laravel api

I am using Laravel/Quasar.
I want to separate the part of the apis in Laravel and the app in node into two virtual machines.
I want to move only the “php-laravel-api” folder to another server. I am interested that the Laravel APIs are in a virtual machine independent from the app.
It’s possible? Where can I configure it?

Your browser will not allow such connections unless the API specifies that the browser should trust the cross-connection. You can do that by locating this file {project root}\app\Http\Middleware\TrustHosts.php or {project root}\php-laravel-api\app\Http\Middleware\TrustHosts.php in your Laravel project, then you can add the IP or domain you the frontend will be communicating with the API from. you can read more here: HTTP Requests - Laravel - The PHP Framework For Web Artisans.