Using the master laravel apl I have successfully created directory. Unzipped the project using Process into the newly created directory. Wrote .env file dynamically from the code. And created a migration file for adding base user. Created database on the server for this new projet. Username and password are same for master app and deployed app. My problem is with running artisan commands.
When I use
Process::path($deploymentPath)->run("php artisan migrate --force");
or
Process->run("php " . $deploymentPath . "/artisan migrate --force");
It fails. It says client table already exists. This is not true as the database is empty. If I migrate manually to the deployed project folder, and run the migrate command. It works without any issues.
My theory is that the artisan command is migrating my master program and not the one being deployed. Even though everything else works alright. Gow do I fix this.
And yes, I am on Ubuntu 24.04 and laravel 11, using mysql 8.