Download the PHP package asligresik/easyapi without Composer
On this page you can find all versions of the php package asligresik/easyapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download asligresik/easyapi
More information about asligresik/easyapi
Files in asligresik/easyapi
Download asligresik/easyapi
More information about asligresik/easyapi
Files in asligresik/easyapi
Vendor asligresik
Package easyapi
Short Description REST API generator for Codeigniter 4
License MIT
Package easyapi
Short Description REST API generator for Codeigniter 4
License MIT
Please rate this library. Is it a good library?
Informations about the package easyapi
easyAPI
What is easyAPI?
easyAPI is skeleton REST API application and integrated with swagger to generate documentation API for Codeigniter 4. With easyAPI you can generate REST API less than 5 minutes.
Installation & setup
- composer require asligresik/easyapi
Publish initial file for swagger documentation
php spark api:publish
this command will copy file- src/Controllers/Swagger.php to app/Controllers
- src/Views to app/Views
- src/public/assets to public/assets
- src/Commands/API/template to app/Commands/API/template
Override default template
- edit file in folder app/Commands/API/template
Generate REST API
php spark api:generate
orphp spark api:generate -p Modules\API\
to generate file in spesific folder after that, system will ask you table name will generate that REST API. We can choose one table or all, if we want generate all writeall
or write one table name exist in your database If there is no error, system will generate for you controller, model and entity file.- Last you must add new route will display in last command to
app/Config/Routes.php
. - Generate api.yaml using command
./vendor/bin/openapi -o ./public/assets/api.yaml ./app
to show API docs using swagger using datasource format yaml (default) - Generate api.json using command
./vendor/bin/openapi -o ./public/assets/api.json ./app
to show API docs using swagger using datasource format json (optional) - Open API documentation in http://localhost:8080/swagger
Feature
- Support searching data using multiple column
- Support searching date column
- Support pagination
Example
- join with other table, you can look at ArtikelKategoriModel.php
- example parameter in swagger for order data _{"order":[{"id":"desc"},{"tglupload":"asc"}]}
- example parameter in swagger for search data _{"search":[{"idkategori":1}]}
- example parameter in swagger for search range data _{"search":[{"tglupload":{"start":"2016-01-01", "end":"2020-01-01"} }]}
- example parameter in swagger for search using like {"search":[{"judul":"membangun%25"}]} or {"search":[{"judul":"%25membangun%25"}]} use
%25
not%
you can place%25
on before, after and combination before and after as your keyword to search data - search data based on column name _{base_url}/artikels?search[idkategori]=1
- order data based on column name _{base_url}/artikels?order[id]=desc&order[tglupload]=asc
- search and order data based on column name _{base_url}/artikels?search[id_kategori]=1&order[id]=desc&order[tglupload]=asc
- search with pagination _{baseurl}/artikels?page=1&limit=10
- search and order with pagination _{base_url}/artikels?search[id_kategori]=1&order[id]=desc&order[tglupload]=asc&page=1&limit=10
- search using between operator if we want filter data based range of date or etc _{base_url}/artikels?search[tgl_upload][start]=2016-01-01&search[tglupload][end]=2020-01-01
- search using keyword _{baseurl}/artikels?search[judul]=membangun%25 or _{baseurl}/artikels?search[judul]=%25membangun%25 will produce like operator on query
-
Search with multiple column
http://localhost:8080/wpOptions?search[option_name]=%mailserver%&search[autoload]=yes&search[option_id][start]=17&search[option_id][end]=18&limit=20
Todo
- [x] create example using this application
Copyright
easyApi dikembangkan dan dimaintain oleh asligresik
Lisensi
Lisensi dari easyApi adalah MIT License namun proyek yang dibangun menyeseuaikan dengan kebijakan masing-masing
All versions of easyapi with dependencies
PHP Build Version
Package Version
The package asligresik/easyapi contains the following files
Loading the files please wait ....