###How to run the application
- Clone the repo
- Create a new .env file using .env.example
cp .env.example .env
- Be sure to set
TRACKTIK_TOKEN
andTRACKTIK_REFRESH_TOKEN
with newly generated values. - Run
composer install
- Run
php artisan serve
- Open in Postman the collection found in project root
- TrackTik Challenge.postman_collection.json
- Play around
In the route /api/{idp}/employees
the idp is a param corresponding to the identity provider
By default I've added first and second. you can replace that with whatever you chose to build in the code
{ "name": "testabs", "surname": "testabs", "email": "sss@test.com" }
{ "first_name": "testabs", "last_name": "testabs", "email": "sss@test.com" }
To create you own IdP follow the steps
- Create a new class in app/IdentityProviders and extend Provider class
- add
$mappingField
key -> value. Copy the value from the other IdP and set the keys tha one your IdP will send in Request Body - Do the same thing in the method
getValidationRules
so change the keys. - In the constructor of EmployeeController add the reference of you class in $this->pathToIdentityProvider, key is the string to be set in the path. value the instance of the class.
- make the request to `/api/whatever/employees