Documentation for the framework can be found on the Laravel website.
Install the following requires (for all OSes):
- [Putty (Windows required, Linux/MacOS optional)] (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)
- VirtualBox
- Vagrant
Of course you want to do this first. Clone the repository wherever you want!
cd ~/.ssh
ls -la | grep "id_rsa"
cd ~/.ssh
ssh-keygen
Follow the prompts
In terminal/cmd, cd
into your project directory, then run vagrant up
. This should initialize
the Scotchbox Vagrant setup. Once the setup is complete you'll be able to use Putty or your Terminal to SSH
in to the box:
- Open Putty
- Use "localhost" for the host and "2222" for the port
- Save configuration, then hit "Open"
- Open Terminal
cd /path/to/project/directory
vagrant ssh
OR
- Open Terminal
- Run
ssh -p 2222 localhost
The username and password are both vagrant
Once you are SSH'd into the server, run the following commands to configure the project for use:
cd /var/www/
composer install
npm install
bower install
gulp
These will configure all of the dependencies. You'll next need to setup the environment variables. These allow you to change from the default MySQL db/user/pass:
cp .env.example .env
- Modify the values in the new .env as necessary, by default you should not need to modify anything
Next, run all of the database configuration commands:
php artisan key:generate
php artisan migrate
php artisan db:seed
Once these commands have all been run, you should be able to access the application through your browser at http://192.168.33.10. If all is working well, you should be greeted with the login page.
As you may have noticed, all of the files under /var/www
match the files that you pulled from the repository. You can do all of
your development using your local IDE against the files you pull from the repository. Thanks to Vagrant, these files are automatically tied
in to your Scotchbox setup.
You will eventually want to shut down vagrant (so you're not running a virtual machine until your Mac needs its monthly reboot). Do that with:
vagrant halt
Username: developer@codeforcharlotte.org
Password: admin
- Register an account with https://mailtrap.io - You can link your github account
- In your local
.env
file append the credentials and settings Mailtrap lists in your demo inbox.
If you receive a "class not found" error when running migrations, try running the composer dump-autoload command and re-issuing the migrate command.
Permissions - Entrust
By default, for development purposes, attachments to the nominatino
form are stored locally, in the storage/forms/
folder.
If the "S3_*" variables are filled in the ".env" file, Amazon S3 will be used instead.
- Create an S3 bucket (The following example assume it is called "cmpd-gift-project")
- Fill in the "S3_REGION" and "S3_BUCKET_FORMS" variables in the ".env" file. for example:
- S3_REGION=us-east
- S3_BUCKET_FORMS=cmpd-gift-project
- Create an IAM user that wil have acccess to the bucket
- Fill in the "S3_KEY" and "S3_SECRET" variables in the ".env" file with the user's credentials
- From the IAM console, create a policy that authorizes the user to use the bucket. For example:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1476893415000",
"Effect": "Allow",
"Action": [
"s3:DeleteObject",
"s3:GetObject",
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::cmpd-gift-project/*"
]
},
{
"Sid": "Stmt1476893524000",
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::cmpd-gift-project"
]
}
]
}