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

Erfan98's avatar

How to automate deployment for 50 client for a laravel application?

Hey all, I have been running a Restaurant Management System running for 5 years. I have engaged about 50 clients who use my application and the number is increasing. Though I have set up some pipelines with bitbucket it's not fully automated. Now I am facing some issues such as. *Some of my clients don't want to use my upgraded software version, So I have to maintain a separate version for them.

  • I have to branch out and write some different functionality for a few clients.
  • Deployment is not fully automated yet.
  • I have so many env vars in my project so it's getting tough for me to deploy.

Now I want to have a dashboard where I can deploy my application within my subdomain for separate users. Such as I have the domain "onlineorder.co.uk" I need to deploy my application to "laracast.onlineorder.co.uk" as my new client's subdomain. More Over I need to have control over my env vars from there. and Yes separate database access also. **NB: they will exist in all one server.

How can I achieve this purpose please if anybody can help me out?

0 likes
1 reply
LaryAI's avatar
Level 58

One way to automate deployment for 50 clients for a Laravel application is to use a deployment tool such as Laravel Envoyer. Envoyer allows you to deploy your application to multiple servers with a single click. It also allows you to manage your environment variables and database access from the dashboard.

You can also use a continuous integration (CI) tool such as Jenkins or Travis CI to automate your deployments. With CI, you can set up a pipeline that will automatically deploy your application to the desired server when a new commit is pushed to your repository.

Finally, you can also use a deployment script such as Deployer to automate your deployments. Deployer is a PHP-based deployment tool that allows you to define a set of tasks that will be executed when you deploy your application.

// Deployer script example

// Define the server
server('production', 'example.com', 22)
    ->user('username')
    ->identityFile()
    ->stage('production')
    ->env('deploy_path', '/var/www/example.com');

// Define the tasks
task('deploy', [
    'deploy:prepare',
    'deploy:lock',
    'deploy:release',
    'deploy:update_code',
    'deploy:shared',
    'deploy:writable',
    'deploy:vendors',
    'deploy:clear_paths',
    'deploy:symlink',
    'deploy:unlock',
    'cleanup',
    'success'
]);

// Run the script
desc('Deploy your project');
task('deploy', [
    'deployer:prepare',
    'deployer:lock',
    'deployer:release',
    'deployer:update_code',
    'deployer:shared',
    'deployer:writable',
    'deployer:vendors',
    'deployer:clear_paths',
    'deployer:symlink',
    'deployer:unlock',
    'cleanup',
    'success'
]);
1 like

Please or to participate in this conversation.