Today I got my new MBP. I was going through the process of installing all of my applications and got to the point where I try to create a new laravel 5 project.
open a folder which will then belong to me ... sudo chmod 777 code
You changed the permissions of this folder not ownership. Error is most likely Composer permissions issue. It's being denied write permissions. How did you install Composer?
That's what you'd type exactly. If you do man which (man = manual).
man which
NAME
which -- locate a program file in the user's path
Running it within ` just executes that command then outputs the result so it's like an automatic way of getting a dynamic path. Can be different on other people's computer but this one command will work for all (so to speak).