This is a PHP API skeleton that is based on the Slim 3 micro framework to help getting started in building REST application.
The project uses the following packages
- illuminate/database which serves as the database layer of the application
- firebase/php-jwt to manage JSON web tokens and for JWT Authentication
- respect/validation for validation
- monolog/monolog for logging
- spatie/fractalistic which is wrapper for ThePhpLeague Fractal which provides presentation and transformation layer data output
- robmorgan/phinx to manage database migrations
- vlucas/phpdotenv to load environment variables stored in
.envfile - fzaninotto/faker for generating faker data
- Run
git clone https://github.com/kennedy-osaze/slim-api-skeleton.gitto clone the repository - Run
composer installfrom the application root folder - From the project root run
cp .env.example .env - Ensure
storage/is web writeable.
- To create migrations, run
vendor/bin/phinx create NameOfMigration - To run migration, run
vendor/bin/phinx migrate - To rollback a migration, run
vendor/bin/phinx rollback - To create a seeder, run
php vendor/bin/phinx seed:create NameOfSeeder - To run a seeder, run
php vendor/bin/phinx seed:run
For more information of migrations and seeders, check out the Phinx Documentation