CodeAnywhere is a great cloud IDE to create web apps but it lacks that latest install of Laravel. So I used the latest PHP stack as my base and then installed the latest version of Laravel 5.5 with additional packages.
Basic Steps to Install Laravel 5.5
- Create a new Container (Hook up a Bitbucket or GitHub repo first if there is an existing repo) use the PHP7 CentOS Stack
- Once container is loaded update composer:
composer self-update
- Then install Laravel on the root of workspace:
composer create-project laravel/laravel basicwebsite
- Install Nano editor:
sudo yum install nano
- Edit Document Root on Apache http config file:
sudo nano /etc/httpd/conf/httpd.conf
- Scroll down a ways to the section where it says Document Root: change that to
home/cabox/workspace/basicwebsite/public
- You can also change working directory to:
home/cabox/workspace/basicwebsite/
- Save changes from the last two steps and exit.
- Restart apache:
sudo apachectl restart
- Change permission of storage directories:
chmod -R ugo+rw storage/
andchmod -R ugo+rw bootstrap/cache/
- You can save this container as a template stack for other future containers.
- Now your Laravel 5.5 app should work. Happy Coding!
Optional: Installing Node/NPM
Furthermore, it may be desirable to install node to compile your laravel assets. Here’s the steps I took to do just that.
- Follow this NVM Guide to install Node
- use this curl command:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
- install node:
nvm install node
cd
in the laravel project directory and runnpm install
. This will install all the required javascript dependencies.- Then you can run
npm run watch
which will start a live server that will be constantly monitoring for any changes to the project sass and js files and update your site accordingly