- Install new instance of Laravel.
- With current repository run
composer update - Current zip contains all dependencies
- With current repository run
- Create new mysql database:
CREATE SCHEMA `bigchoice` ; - Rename
.env.exampleto.envand update.envfile with the connection details to the database. - Run migrations to create the databases
php artisan migrate - Laravel has a built in development server
otherwise, serve the code accordingly to the /public directory.
php artisan serve
The main controller is the CountryController.
I have created the following files
- \App
- \Actions
- RetrieveFromApi.php
- RetrieveFromDb.php
- StoreCountry.php
- \Http\Controllers
- CountryCountroller.php
- \Utilities
- Curl.php
- Country.php
- Currency.php
- Dialingcode.php
- Language.php
- Timezone.php
- \Actions
- \database\migrations
- 2019_09_08_083021_create_countries_table.php
- 2019_09_08_092100_create_languages_table.php
- 2019_09_08_093854_create_timezones_table.php
- 2019_09_08_083907_create_currencies_table.php
- 2019_09_08_092633_create_dialingcodes_table.php
- \resources\views
- results.blade.php
- searchForm.blade.php
- welcome.blade.php
- \routes
- web.php
Other files are framework files, there by default on installation.
- Searching for more than one field will
ORsearch each value - If a DB search returns at least one country it will not check the API for completeness, e.g. if on a fresh DB currency: EUR is searched, followed by a search for currency: GBP, only Zimbabwe will be returned. Searching for Country code: GB followed by currenct: GBP will then return Great Britain and Zimbabwe.