Laravel 8.73, laravel passport 10.2, vue 2.6.12, vue-router 3.5.1, vuex 3.6.2, Bootstrap 4.
- PHP version >= 8.0 (php -v).
- Composer installed.
- npm installled.
- Frontend (SPA) built with [Bootstrap] (login, Customers listing with pagination, custumer details etc..)
- OAuth2 authentication implementation using laravel passport
- Command to import all customers from customers.csv
- Job to get customer latitude & longitude base on address using Google Maps API
- API Documentation & testing
/api/docs
- PHPUnit test for all features.
-
Clone the project under your web server's root directory using git or Download (as zip) and extract.
$ git clone https://github.com/dukenst2006/php-challenge.git
- Install dependencies with
Composer
:
$ composer install
- Install dependencies with
-
Create a file .env using .env.example. Update the files - set app url, database connection, passport details like client_id & client_secret and GOOGLE_MAPS_API_KEY.
$ cp .env.example .env
-
Run
php artisan key:generate
-
Create two databases one for app (e.g api) and one for app testing (e.g api_testing).
-
Install front-end dependencies with
npm
:$ npm install && npm run dev
-
Run
php artisan migrate --seed
, this will create a user for testing. You can useemail: test@gmail.com
,pwd: secret
-
Run
php artisan passport:install
. Note Client ID & Client secret provided. it will required to get API authorizations from/api/docs
endpoint -
Run
php artisan import-customers:csv
to import customers from customers.csv file. NB: latitude & longitude will be fill from Google map API -
To run the tests use:
$ php artisan test
Make sure update the .env.testing file