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

skoobi's avatar
Level 13

Laravel Environment setups

Hi sorry for the newbie questions i've been going through the laravel from scratch series of tutorials and i'm a little confused on a few things work regarding environments. I've been looking at laravel for sometime and been wanting to use it on a project but never really strayed much from codeigniter, but a project has just come up where laravel suits the specs (future proofing) its a perfect time for me to try and learn laravel and as it's a relaxed project where i can take my time.

So heres my questions i hope they make sense :)

  1. What i'm looking to do is use mamp/homestead as my localhost and then push it via git to Heroku (my production server) when i'm happy. I've started doing this with heroku already and it works brilliantly but is it the right way? or is there another way?

  2. How do developers mainly have their setup and how do you deploy it to the production server when its in development to show to the client and when it's live and need to do an update?

  3. With the databases how do you manage them both? I.e. i've setup my localhost mysql using mamp and a cleardb on Heroku but if i want to do a migrate and rollback will it effect the two? Or do i just have a live database on heroku and just use that. But then that won't be good as it will be live at some point.

Any help or guidance with this would be greatfull

Cheers Chris

0 likes
2 replies
rossuhms's avatar
Level 4

Hi Chris,

The best development enviroment for working with Laravel is to use Laravel Homestead which makes use of a Virtual Machine. This allows you to manage several laravel installations on a VM without installing PHP & loads of other dependencies on your local machine. The following is available out of the box:

  • Ubuntu 14.04
  • Git
  • PHP 7.0
  • HHVM
  • Nginx
  • MySQL
  • MariaDB
  • Sqlite3
  • Postgres
  • Composer
  • Node (With PM2, Bower, Grunt, and Gulp)
  • Redis
  • Memcached
  • Beanstalkd

Depending on which OS you are using installation isn't too difficult. Mac is easier though.

Laravel Valet was also released a few days ago. This is only available for mac users.

The above are the recommended and preferred options however you are perfectly able to use MAMP.

Laravel Forge allows you to manage a sever on either AWS, DigitalOcean or Linode. Forge will configure your server correctly to ensure you have all the necessary dependencies required to run Laravel in production. It also links up to your version control (GitHub, Bitbucket etc) and will manage deploying your app.

In response to your database question I would recommend installing whichever database engine your going to be using in production, on your development environment. This will reduce the risk of any problems in production. MariaDB is a good option.

For a painless experience with Laravel I would recommend Homestead + Forge + GitHub + DigitalOcean.

1 like
skoobi's avatar
Level 13

Thank you for your reply very helpful. Like you said at the end I think I'll try the homestead+forge+GitHub approach and see how I get on. I use digital ocean on some over projects but intill I just read forge that looks a heck of a lot easier to setup it up.

Cheers

Please or to participate in this conversation.