PHP Fast is a mini framework use to create REST APIs in minutes.
PHP Fast provides very easy and simple folder structure to work with, where you will have all basic necessary functions.
- public
- config
- config.dev.php
- config.php
- config.prod.php
- env.php
- app
- predefined
- Database.php
- Model.php
- Request.php
- Response.php
- Service.php
- Validate.php
- user-defined
- predefined
- .htaccess
- index.php
- init.php
- models.php
- setup.php
Example : Lets take an example of entity like Student
- /students : GET Returns all students
- /student/:id : GET Returns one student
- /student : POST Save student
- /student/:id : DELETE Delete student by ID
- /student/:id : PUT Update student by ID
We are using PHP associative arrays to define model
Example : Define Student Model
Define field in this format
field | type | is_required
$models['student'] = array( array('name', 'string', true) );
- Validation
- Foreign Key Constraint
- Authentication JWT