PHPackages                             robertmain/codeigniter-starter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. robertmain/codeigniter-starter

ActiveLibrary

robertmain/codeigniter-starter
==============================

4131[2 issues](https://github.com/robertmain/codeigniter-starter/issues)[1 PRs](https://github.com/robertmain/codeigniter-starter/pulls)PHPCI passing

Since Mar 16Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/robertmain/codeigniter-starter)[ Packagist](https://packagist.org/packages/robertmain/codeigniter-starter)[ RSS](/packages/robertmain-codeigniter-starter/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (9)Used By (0)

CodeIgniter Starter
===================

[](#codeigniter-starter)

[![Build Status](https://camo.githubusercontent.com/1f77938fee2e8f7b822542ce169c0218b137f2a894c76b8788b9fe93e05f58d6/68747470733a2f2f7472617669732d63692e6f72672f726f626572746d61696e2f636f646569676e697465722d737461727465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/robertmain/codeigniter-starter) [![Dependabot Status](https://camo.githubusercontent.com/7e9a809e7ec5469e4fb8031d11076ce43294123206310dd95c15ccabeeea6343/68747470733a2f2f6170692e646570656e6461626f742e636f6d2f6261646765732f7374617475733f686f73743d676974687562267265706f3d726f626572746d61696e2f636f646569676e697465722d73746172746572)](https://dependabot.com)

A CodeIgniter starter application designed to get up and running and to be able to write code that is as clean, and testable as possible.

Installation
------------

[](#installation)

- With Composer: `composer create-project robertmain/codeigniter-starter --dev`
- Manually: `git clone https://github.com/robertmain/codeigniter-starter`

Why
---

[](#why)

CodeIgniter applications are currently very difficult to test, since most rely on the huge God object `$this` that everything else (including the class loader ಠ\_ಠ) decend from.

This project brings Composer into the mix, both to load third-party libraries from Packagist, and to facilitate the namespacing of models. This in-turn allows us to create abstractions of business objects that are more testable as a single unit of code and are easier to deal with in the application.

What
----

[](#what)

This CodeIgniter starter project provides the following:

### Testing

[](#testing)

A fully functional PHPUnit/Mockery setup with namespaced models

### A Base Model

[](#a-base-model)

A basic model abstraction providing some limited CRUD functionality and CRUD lifecycle callbacks. This was inspired by [Jamie Rumbelow's Base Model](https://github.com/jamierumbelow/codeigniter-base-model) but diverged in order to support soft deletes.

This base model also provides the metadata field names for `created_at`, `updated_at` and `deleted_at`. This is re-used in the abstract base migration to provide the names of the fields to create as datestamp fields.

### Templating

[](#templating)

The `Plates` templating engine was broguht in to handle templating in CodeIgniter. This allowed for greater flexibility in frontend layout, particularly in regards to things like template reigions, inheritence and partial re-use etc.

### Namespacing

[](#namespacing)

Models can now be namespaced in `App\Models`. The loader has been extended to support this, however it should behave normally. We get this behaviour for free by using Composer and PSR-4 namespacing in our models.

**Please note:** due to the way that CodeIgniter loads controllers, controllers cannot be namespaced at this time, otherwise the framework will be unable to locate them.

### Environmental Configuration

[](#environmental-configuration)

Dotenv is now used to provide database settings. This prevents database configuration accidentally being comitted and provides an easy, consistent way to setup seperate environments

### Composer Scripts

[](#composer-scripts)

Composer scritps have also been provided to help manage the development of the application. These are:

- `test:models` - Test the application models
- `test:controllers` - Test the application controllers
- `test` - Test models and controllers
- `docs` Generate php docs from the models and controllers
- `migrate:latest` - Run the latest database migration and upgrade the database to the latest version
- `migrate:flush` - Drop the entire database and re-create it. For safety reasons, the application will raise an exception if asked to drop it's database in a production environment

### Exceptions

[](#exceptions)

This starter project also includes `crazycodr/standard-exceptions` which are used to provide a standardised set of PHP exceptions for common scenarios.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance44

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b9aa11ca93e5f6a9181fed7f2124cde89f0c326fd02e7924d1b980f02905578b?d=identicon)[robertmain](/maintainers/robertmain)

---

Top Contributors

[![robertmain](https://avatars.githubusercontent.com/u/537684?v=4)](https://github.com/robertmain "robertmain (145 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (32 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (8 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

codeignitercomposermvcphpunit-testing

### Embed Badge

![Health badge](/badges/robertmain-codeigniter-starter/health.svg)

```
[![Health](https://phpackages.com/badges/robertmain-codeigniter-starter/health.svg)](https://phpackages.com/packages/robertmain-codeigniter-starter)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
