ikaler / slim3-api-base
Slim 3 based Restful api base project.
dev-master
2017-03-23 17:25 UTC
Requires
- monolog/monolog: ^1.22
- slim/slim: ^3.0
Requires (Dev)
- phpunit/phpunit: 5.7.*
This package is not auto-updated.
Last update: 2025-04-26 22:59:26 UTC
README
This is a base project for RESTful api based on Slim 3 framework.
Create project:
$ composer create-project --no-interaction --stability=dev ikaler/slim3-api-base my-slim-api
Replace my-slim-api
with the desired directory name for your new application.
Configure project:
$ cd my-slim-api
or the name you provided above$ cp app/config_default.php app/config.php
$ mkdir logs
$ touch logs/app.log
Directories
app
: Application codelogs
: Log filespublic
: Webserver rootvendor
: Composer dependencies
Sample User table
CREATE TABLE IF NOT EXISTS `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(25) NOT NULL,
`email` varchar(30) NOT NULL,
`password` varchar(32) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
Added few sample files UserController.php
, UserModel.php
to get started.