Modus PHP Backend API using Laravel
This is a short coding assignment, which implement an API in PHP Laravel that calls a "backend API" to get information about crash test ratings for vehicles.
The underlying API that is to be used here is the NHTSA NCAP 5 Star Safety Ratings API
- PHP : 7.2.15
- Laravel : 5.8.*
- Composer
# Clone git repository
$ git clone git@github.com:hassanjamal/modus-nhtsa-api.git
# Change working directory
$ cd modus-nhtsa-api
# Create ENV file and generate key
$ cp .env.example .env && php artisan key:generate
# Install Composer dependencies
$ composer install
$ php artisan serve --port=8080
$ ./vendor/bin/phpunit
- Requirement 1 Github Issue Link
GET http://localhost:8080/vehicles/<MODEL YEAR>/<MANUFACTURER>/<MODEL>
- Requirement 2 Github Issue Link
POST http://localhost:8080/vehicles
- Requirement 3 Github Issue Link
GET http://localhost:8080/vehicles/<MODEL>/<YEAR>/<MANUFACTURER>/<MODEL>?withRating=true
$ php artisan config:clear && php artisan clear-compiled && php artisan cache:clear