Laravel 5.2 app cases
- Clone project
- Create new database
- Run Custom mySql migration scripts : /database/migrationScripts/22-05-2016.setup.sql
- Run composer : composer install
- Create .env file with your own settings
- Define ownership of the Directory in terminal : chown -R {pc-name}:www-data ./
- Open Postman and import scripts : /Laravel-api.postman_collection.json
Most of the methods in the application are example methods and could be refined. Move Validation in the Request validation and adapt the error method for request objects for API.
A user is automatically generated if none have been created. email : [email protected] password : p
- View all
- View single
- Create
- View all
- View single
- Create
To gain access to all the calls you need to generate a API token : script provided. The Token needs to be placed in the header of each request which will validate the request and user.
Im currently using the default ORM for models but i am not using any of the default migrations. This is because i feel its important for people to understand the correct way to layout tables and relations.
Iv taken 2 approaches to the model,
- default structure and behavior for models
- Data Mapper as seen in the users Model where the methods are defined and easily tracked.
NONE