Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Daniel-Pablo's avatar

Open port in SAIL

Hi, thanks for your help, I am trying to connect to a docker container running sail with a laravel inside

before it was working with XAMP and was pretty easy to make a call to a route in the localhost, but I got to change to sail thus PHP 8 dont work with XAMP so This is the code that was working, but no longer thus I am running SAIL so what I got to add to the DOCKER file in order to make this works... or open the ports... no idea how to

// this was the route that is going to be called
   Route::get('/generateToken', function () {
        return csrf_token();
    });

// then this was called externaly from another program to collect the request of the GET 
http:/ /localhost/generateToken // here I make a space in the slash in order to not make a comment

hope make sense thanks in advance

0 likes
4 replies
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

Not sure why this would require another port? Is the other app also in docker?

Daniel-Pablo's avatar

@sinnbeck hi , look I am running a UNITY APP, this unity app make a request to a URL, in this case is the local host but on production it is the url of the web page, but right now it was working with XAMP , but after change it to SAIL, it stop working in fact the request dont get to the host... or server or SAIL Route, donbt have to much knoledge about it but with this change from XAMP to SAIL its now broken

Thanks for your help :)

Sinnbeck's avatar

@Arius Tigger are you getting an error? Can you show the docker-compose.yml?

Daniel-Pablo's avatar

hi @sinnbeck now solved, all was good and docker did not need any additional port, I re-check the routes and there was a conflict between versions, the routes were written in L6 and now we are in L9 so that has the problem on routes calling the controllers,

Thanks for all your time and effort on this case regards Arius

Please or to participate in this conversation.