{"id":14987353,"url":"https://github.com/gunantos/ci4restfull-starter","last_synced_at":"2025-04-12T00:04:04.142Z","repository":{"id":62486383,"uuid":"366082070","full_name":"gunantos/ci4restfull-starter","owner":"gunantos","description":"Create simple Restfull Api With Codeigniter 4 Framework","archived":false,"fork":false,"pushed_at":"2021-08-15T05:36:47.000Z","size":187,"stargazers_count":17,"open_issues_count":0,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T00:03:45.715Z","etag":null,"topics":["api","codeigniter4","database","php","phpauthentication","rest-api","restfull-api"],"latest_commit_sha":null,"homepage":"https://gunantos.github.io/ci4restfull-starter/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gunantos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://sponsor.app-kita.net"]}},"created_at":"2021-05-10T15:02:17.000Z","updated_at":"2024-10-03T05:05:19.000Z","dependencies_parsed_at":"2022-11-02T10:02:49.102Z","dependency_job_id":null,"html_url":"https://github.com/gunantos/ci4restfull-starter","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gunantos%2Fci4restfull-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gunantos%2Fci4restfull-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gunantos%2Fci4restfull-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gunantos%2Fci4restfull-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gunantos","download_url":"https://codeload.github.com/gunantos/ci4restfull-starter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248497808,"owners_count":21113984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","codeigniter4","database","php","phpauthentication","rest-api","restfull-api"],"created_at":"2024-09-24T14:14:29.608Z","updated_at":"2025-04-12T00:04:04.111Z","avatar_url":"https://github.com/gunantos.png","language":"PHP","funding_links":["https://sponsor.app-kita.net"],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://app-kita.com\" alt=\"app-kita, app kita\"\u003e\u003cimg src=\"https://app-kita.com/img/logo-teks.965d24bf.png\" width=\"100\"\u003e\u003c/a\u003e\u003cbr\u003e\n[![PHP Composer](https://github.com/gunantos/ci4restfull-starter/actions/workflows/php.yml/badge.svg)](https://github.com/gunantos/ci4restfull-starter/actions/workflows/php.yml)\n![Discord](https://img.shields.io/discord/846036920811126844?style=plastic)\n[![GitHub issues](https://img.shields.io/github/issues/gunantos/ci4restfull-starter)](https://github.com/gunantos/ci4restfull-starter/issues)\n[![GitHub license](https://img.shields.io/github/license/gunantos/ci4restfull-starter)](https://github.com/gunantos/ci4restfull-starter/blob/main/LICENSE)\u003cbr\u003e\n\u003ca href=\"https://sponsor.app-kita.net\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/github/sponsors/gunantos?logo=gunantos\u0026style=for-the-badge\" title=\"Pay Coffe\" /\u003e\u003c/a\u003e\u003cbr\u003e\n# CodeIgniter 4 Restfull API Application Starter\n\nCodeigniter 4 Restfull is the creation of Restfull API with the codeigniter 4 framework. Use is very simple and easy to use. And support with 4 types of security authentication ex. JWT, Basic, Key, Token\n\nYou can manage api using database or File configuration\n\nfollow Setup Configuration!\n\n## Chat\n[Discord](https://discord.gg/bXUWCSaw)\n\n\n## Installation \u0026 updates\n\n- composer\n\n```sh\ncomposer create-project appkita/ci4restfull-starter\ncd ci4restfull-starter\ncomposer update\n```\n\n-manual\n\n1.  Download latest release from `https://github.com/gunantos/ci4restfull-starter/releases`\n2.  extract to public_html\n3.  `composer install`\n\n## Setup\n\n- Copy `env` to `.env` and tailor for your app, specifically the baseURL, any database settings and Restfull setting.\n\n`or`\n\n- Open Folder `App/Config/Restfull` and edit\n\n```php\n   //you can set database of file\n   public $cekfrom = 'file'\n\n   //configuration user cek\n  public $user_config = [\n      'model' =\u003e 'UserModel', //model name or parameter if you using file\n      'username_coloumn'=\u003e'email',\n      'password_coloumn'=\u003e'password',\n      'key_coloumn' =\u003e 'apikey',\n      'path_coloumn'=\u003e'path',\n      'block_coloumn'=\u003e'isblock',\n      'whitelist_coloumn'=\u003e'whitelist',\n      'blacklist_coloumn'=\u003e'blacklist'\n    ];\n\n    //if you using file $cekfrom\n    $UserModel = [\n   \t[\n        'email'=\u003e'user@email.com',\n        'password'=\u003e'password',\n        'apikey'=\u003e'123123',\n        'isblock'=\u003efalse,  //if you block return true\n        'whitelist'=\u003e[], //add whitelist ip address\n        'blacklist'=\u003e[], //add blacklist ip address\n        'path'=\u003e'*' //use * for allow all access or array controllername_methodname\n      ]\n     ]\n\n    //Configuration your Header API KEY\n    public $haderKey = 'X-API-KEY';\n\n    /**\n     * @var array $allowed_key_parameter\n     * if you API KEY allowed get from parameter GET, POST, or JSON\n     */\n    public $allowed_key_parameter = ['get', 'post', 'json'];\n    //configuration data include on json token\n   $token_data = 'username';\n\n   public $allowed_format = ['json', 'xml', 'csv'];\n\n    /**\n     * @var string $default_format\n     */\n    public $default_format = 'json';\n\n```\n\n- Create new Controller extends `RestfullApi`\n\n```php\n  \u003c?php\n\nnamespace App\\Controllers;\nuse \\Appkita\\CI4Restfull\\RestfullApi;\nuse \\App\\Models\\UserModel;\n\nclass Home extends RestfullApi\n{\n\t#protected $modelName = 'UserModel';\n\tprotected $model;\n    protected $allowed_format = ['json'];\n\n\tprotected $auth = ['key'];\n\n\tfunction __construct() {\n\t\t$this-\u003emodel = new UserModel();\n\t}\n\tpublic function index()\n\t{\n\t\treturn $this-\u003erespond(['status'=\u003etrue, 'data'=\u003e$this-\u003emodel-\u003efindAll()]);\n\t}\n\n\tpublic function show($id = null)\n\t{\n\t\treturn $this-\u003erespond(['status'=\u003etrue, 'data'=\u003e$this-\u003emodel-\u003efind($id)]);\n\t}\n\n\tpublic function create() {\n\t\tdie('create ');\n\t}\n\n\tpublic function update($id = null) {\n\t\tdie('update '. $id);\n\t}\n\n\tpublic function deleted($id = null) {\n\t\tdie('deleted '. $id);\n\t}\n}\n\n```\n\n- Run application with `spark` or `host`\n\n```sh\n  //spark\n  php spark serve\n```\n\n- acess api\n  `http://localhost:8080` spark run\n  `http://localhost/yourapi/public` xamp or wamp\n\n## Important\n\n**Please** read the user guide of [Codeigniter 4](https://codeigniter.com/user_guide/)\n\n# Sponsor\n\n[Pay Coffe](https://sponsor.app-kita.net)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgunantos%2Fci4restfull-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgunantos%2Fci4restfull-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgunantos%2Fci4restfull-starter/lists"}