In order to run the application you need to setup server with:
- PHP 7+
- MySQL 5.7+
For development process, you should use Laravel Homestead
In order to follow code standards, you should use PSR-2, install PHP CS Fixer and before each commit you should run this fixer to make sure your code is properly formatted. Base CS fixer configuration file has created as .php_cs to make sure every developer uses the same rules for code formatting.
-
Copy
.env.exampleas.env -
Run
composer install -
In
.envfile:- Set
APP_KEYto random 32 characters long string using the following command:
php artisan key:generate-
If you set
SQL_LOG_QUERIESorSQL_LOG_SLOW_QUERIESto true (to log SQL queries), make sure you have created directory set asSQL_LOG_DIRECTORYin storage path and you have valid permissions to create and override files in this directory -
Fill in all other data in
.envfile (database connection admin e-mail and password and so on)
- Set
-
Run
php artisan jwt:generate --showand put key you got into .
envfile asJWT_SECRETvalue -
Run
php artisan migrate --seedto run migrations and seeds into database
In order to run phpunit tests you should prepare a few things.
-
You need to create separate database connection and set it in
.envfile inTESTINGsection -
Run
php artisan migrate --seed --database=mysql_testingto run all migrations and seeds into this testing database (don't changemysql_testingwhen running into this command - it's not the database name!) -
You should make sure that in your
.envfileMAIL_HOSTis set tomailtrap.ioand all e-mail settings are filled correctly -
Now you need to fill in
MAILTRAP_API_TOKENandMAILTRAP_API_INBOXbased on your mailtrap account. To do that, you should log in into yourmailtrap.ioaccount, and go tohttps://mailtrap.io/public_apiwhere you have your API key. To get your API inbox you need to go tohttps://mailtrap.io/inboxesand when you click your inbox just use id that you will find in url.