Getting started

Install laravel

composer create-project laravel/laravel fdb --prefer-dist

Head over to the Homestead folder, and install the project in Homestead.yaml

    - map: ~/Google Drive/Sites/laravel/blog
      to: /home/vagrant/blog
    - map: ~/Google Drive/Sites/laravel/larabook
      to: /home/vagrant/larabook
    - map: ~/Google Drive/Sites/laravel/fdb
      to: /home/vagrant/fdb

    - map:
      to: /home/vagrant/blog/public
    - map:
      to: /home/vagrant/larabook/public
    - map:
      to: /home/vagrant/fdb/public

    - name: learn
    - name: larabook
    - name: fdb

Now to change the hosts file which is in /etc/hosts – add this at the end:

Next, if vagrant isn't running you need to run:

vagrant up

to start the server.

Vagrant is already running

You need to run

vagrant provision
* I think this is the best one

I have a weired "No input file specified" warning?

vagrant reload

Congratulations, you should now be able to find the website here!

Vagrant doesn't run

If vagrant doesn't run, there is a good chance that Virtual Box isn't working correctly. The best bet is to Restart it * great fix for Command: ["hostonlyif", "create"] issues

sudo /Library/StartupItems/VirtualBox/VirtualBox restart

When its time to switch off vagrant, run:

vagrant halt

Adding database

You need to create a new database

Set it up. (i.e. just add a new database with the right name in Sequel Pro)
Now just add an .env file. I.e. .env.local.php in the root of your app (next to vendor and app). Fill it up like this:

return [
    'DB_HOST' => 'localhost',
    'DB_NAME'  => 'entry',
    'DB_USER'  => 'homestead',
    'DB_PASS'  => 'secret',

Now go back through and swap out all references to the database password etc with the following


I want to set it up faster

Don't be confused by the local and production environment variable. Just for now, look here:


Put in the details. They should already be about correct, just update the database name.


Fire up Sequel pro, add a new favourite and from the menu at the top,

The settings should be along the lines of the below

Name: FDB
Username: homestead
Password: secret
Database: /* database name */
Host: 33060

Pat yourself on the back.

Adding users

We need to add a few migrations, the easiest way by far is using Jeffrey Way's generator class.

Uploads don't work

  1. Log into Putty and edit nginx.conf by typing:
    sudo vi /etc/nginx/nginx.conf
  2. When in this file, add this line of code within the 'http' block:
    client_max_body_size 8M;
  3. Save the file above by typing:
  4. If using Laravel Homestead (Which I am), edit 'php.ini' by typing:
    sudo vi /etc/php5/fpm/php.ini
  5. When in this file, scroll down until you're about 40% into the document and you find the line of code:
    upload_max_filesize = 2M
    Change this code above to:
    upload_max_filesize = 8M
  6. Save the file above by typing:
  7. In Putty, type the following commands:
    sudo service nginx restart
    sudo service php5-fpm restart