{"id":15307049,"url":"https://github.com/kenjis/ci4-news","last_synced_at":"2025-04-15T00:54:21.173Z","repository":{"id":64478202,"uuid":"570548909","full_name":"kenjis/ci4-news","owner":"kenjis","description":"CodeIgniter 4 News Tutorial","archived":false,"fork":false,"pushed_at":"2024-03-21T01:35:59.000Z","size":450,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-15T00:54:13.629Z","etag":null,"topics":["codeigniter","codeigniter4","php","tutorial"],"latest_commit_sha":null,"homepage":"","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/kenjis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-11-25T13:07:38.000Z","updated_at":"2023-11-05T04:05:29.000Z","dependencies_parsed_at":"2023-11-08T06:40:51.032Z","dependency_job_id":"701f54ca-7f7a-4403-9a95-15e5d3a90d10","html_url":"https://github.com/kenjis/ci4-news","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjis%2Fci4-news","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjis%2Fci4-news/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjis%2Fci4-news/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjis%2Fci4-news/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kenjis","download_url":"https://codeload.github.com/kenjis/ci4-news/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248986279,"owners_count":21194025,"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":["codeigniter","codeigniter4","php","tutorial"],"created_at":"2024-10-01T08:08:54.443Z","updated_at":"2025-04-15T00:54:21.151Z","avatar_url":"https://github.com/kenjis.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CodeIgniter 4 News Tutorial\n\nSee \u003chttps://codeigniter4.github.io/CodeIgniter4/tutorial/index.html\u003e.\n\nIf you want to see code to use Auto Routing,\nsee the [auto-routing](https://github.com/kenjis/ci4-news/tree/auto-routing#codeigniter-4-news-tutorial) branch.\n\n## Folder Structure\n\n```\nci4-news/\n├── app/\n├── tests/\n├── composer.json\n├── composer.lock\n├── public/\n│   ├── .htaccess\n│   └── index.php\n└── vendor/\n    └── codeigniter4/\n        └── codeigniter4/\n```\n\n## Requirements\n\n- PHP 7.4 or later\n- `composer` command (See [Composer Installation](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos))\n- Git\n\n## How to Use\n\n### Installation\n\n```console\n$ git clone https://github.com/kenjis/ci4-news\n$ cd ci4-news/\n$ composer install\n```\n\n### Database Migration and Seeding\n\nOptional, if you use SQLite3 by default.\n\n```console\n$ php spark migrate\n$ php spark db:seed NewsSeeder\n```\n\n### Run PHP built-in Server\n\n```console\n$ php spark serve\n```\n\n### URLs\n\n| Method | URL                               | Controller   | Description                         |\n|--------|-----------------------------------|--------------|-------------------------------------|\n| GET    | http://localhost:8080/            | Home::index  | the CodeIgniter Welcome page        |\n| GET    | http://localhost:8080/pages       | Pages::index | the CodeIgniter Welcome page        |\n| GET    | http://localhost:8080/home        | Pages::view  | the “home” page                     |\n| GET    | http://localhost:8080/about       | Pages::view  | the “about” page                    |\n| GET    | http://localhost:8080/shop        | Pages::view  | a “404 - File Not Found” error page |\n| GET    | http://localhost:8080/news        | News::index  | the news list page                  |\n| GET    | http://localhost:8080/news/{slug} | News::show   | the news item page                  |\n| GET    | http://localhost:8080/news/new    | News::new    | the news create form                |\n| POST   | http://localhost:8080/news        | News::create | the news creation and the result    |\n\n#### Routes\n\n```\n+--------+--------------+------+---------------------------------+----------------+---------------+\n| Method | Route        | Name | Handler                         | Before Filters | After Filters |\n+--------+--------------+------+---------------------------------+----------------+---------------+\n| GET    | /            | »    | \\App\\Controllers\\Home::index    |                | toolbar       |\n| GET    | news         | »    | \\App\\Controllers\\News::index    |                | toolbar       |\n| GET    | news/new     | »    | \\App\\Controllers\\News::new      |                | toolbar       |\n| GET    | news/([^/]+) | »    | \\App\\Controllers\\News::show/$1  |                | toolbar       |\n| GET    | pages        | »    | \\App\\Controllers\\Pages::index   |                | toolbar       |\n| GET    | ([^/]+)      | »    | \\App\\Controllers\\Pages::view/$1 |                | toolbar       |\n| POST   | news         | »    | \\App\\Controllers\\News::create   | csrf           | toolbar       |\n+--------+--------------+------+---------------------------------+----------------+---------------+\n```\n\n### Run PHPUnit Tests\n\n```console\n$ composer test\n```\n\n## Related Projects for CodeIgniter 4.x\n\n### Libraries\n\n- [CodeIgniter 3 to 4 Upgrade Helper](https://github.com/kenjis/ci3-to-4-upgrade-helper)\n- [CodeIgniter3-like Captcha](https://github.com/kenjis/ci3-like-captcha)\n- [PHPUnit Helper](https://github.com/kenjis/phpunit-helper)\n- [CodeIgniter4 Attribute Routes](https://github.com/kenjis/ci4-attribute-routes)\n- [CodeIgniter Simple and Secure Twig](https://github.com/kenjis/codeigniter-ss-twig)\n- [CodeIgniter4 Viewi Demo](https://github.com/kenjis/ci4-viewi-demo)\n\n### Tutorials\n\n- [CodeIgniter 4 News Tutorial](https://github.com/kenjis/ci4-news)\n- [CodeIgniter 4 Validation Tutorial](https://github.com/kenjis/ci4-validation-tutorial)\n- [CodeIgniter4 Code Modules Test](https://github.com/kenjis/ci4-modules-test)\n- [CodeIgniter 4 File Upload](https://github.com/kenjis/ci4-file-upload)\n- [CodeIgniter 4 QueryBuilder Batch Sample](https://github.com/kenjis/ci4-qb-batch-sample)\n\n### Building Development Environment\n\n- [CodeIgniter4 Application Template](https://github.com/kenjis/ci4-app-template)\n- [CodeIgniter4 Composer Installer](https://github.com/kenjis/ci4-composer-installer)\n- [docker-codeigniter-apache](https://github.com/kenjis/docker-codeigniter-apache)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenjis%2Fci4-news","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkenjis%2Fci4-news","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenjis%2Fci4-news/lists"}