The error message suggests that the X-Frame-Options header is still set to deny or sameorigin. To allow the iframe access, you need to set the X-Frame-Options header to allow-from with the domain of site B. You can modify the myXFrame middleware as follows:
<?php
namespace App\Http\Middleware;
use Closure;
class myXFrame
{
public function handle($request, Closure $next)
{
$response = $next($request);
$response->header('X-Frame-Options', 'ALLOW-FROM http://B');
return $response;
}
}
Replace http://B with the actual domain of site B.