Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reach Laravel Sail working directory from terminal?

I want to connect my terminal to sail for running commands and edit files in sail containers.

I found that I can execute php artisan commands like: sail artisan migrate replacing php to sail.

But I want to get into: /var/www/project in container to execute php artisan migrate

What aliases exists for this?

like image 283
Aipo Avatar asked Feb 03 '26 21:02

Aipo


1 Answers

You can use sail shell as sail user or sail root-shell as root user. Then you can run any command inside the container.

In order to run php artisan commands just use sail shell then run your commands. However, remember sail artisan commands is always there for you.

source: https://laravel.com/docs/10.x/sail#sail-container-cli

like image 159
Hadi Aghandeh Avatar answered Feb 05 '26 12:02

Hadi Aghandeh