eliseekn / tinymvc
TinyMVC is a PHP framework based on MVC architecture that helps you build easily and quickly powerful web applications and RESTful API.
Package info
Type:project
pkg:composer/eliseekn/tinymvc
Requires
- php: ^8.4
- cweagans/composer-patches: *
- dflydev/dot-access-data: ^3.0
- doctrine/dbal: ^4.3
- dompdf/dompdf: ^3.0
- goldspecdigital/oooas: dev-master
- nesbot/carbon: ^3.0
- phpmailer/phpmailer: ^6.9
- predis/predis: ^2.2
- psy/psysh: ^0.12
- somnambulist/validation: ^1.12.2
- spatie/php-structure-discoverer: ^2.0
- standaniels/image-generator: ^1.1.0
- symfony/console: ^7.2
- symfony/http-client: 8.0.x-dev
- symfony/mime: ^7.2
- symfony/panther: ^2.4
- symfony/process: ^7.2
- twig/twig: ^3.16
- twilio/sdk: ^8.3
Requires (Dev)
- fakerphp/faker: ^1.24
- filp/whoops: ^2.16
- friendsofphp/php-cs-fixer: ^3.68
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^11.5
- symfony/finder: ^7.2
- symfony/test-pack: ^1.1
- symfony/var-dumper: ^7.2
This package is auto-updated.
Last update: 2026-08-20 18:54:15 UTC
README
TinyMVC is a PHP framework based on MVC architecture that helps you build easily and quickly powerful web applications and RESTful API.
Requirements
PHP ^8.4
Node ^20.20
Installation
- Create new composer project
In your terminal :
composer create-project eliseekn/tinymvc project-name
- Install packages dependencies
In your terminal :
cd ./project-name
yarn && yarn dev
Your first application
- Setup application
In your terminal :
cp .env.example .env
php console app:setup
- Setup database
In your terminal :
php console migrations:run --seed
- Start a local server development
In your terminal :
php console serve
For more console commands :
php console list
Database layer
TinyMVC mixes the Laravel and Symfony approaches : the model is the query gateway, the entity is the typed result.
Models (query gateway)
A model is a table-oriented query gateway built on the query builder :
php console make:model post
Entities (typed results)
An entity is a typed class mapped to a table row. Generate one with :
php console make:entity post
The command prompts you for fields interactively, or you can pass them directly :
php console make:entity post --fields="title:string, views:int, published:bool, published_at:datetime" -m
Options : --fields to define typed properties (string, text, int, float, bool, datetime, ...) and -m to create the migration.
Querying and persisting
Query through the model, get entities back using toEntity(), and persist through the entity itself :
use App\Database\Entities\Post as PostEntity; use App\Database\Models\Post; class Post extends Model { public static function findByTitle(string $title): ?PostEntity { return self::query()->findBy('title', $title)?->toEntity(PostEntity::class); } } // query using the model, get a typed entity as result $post = Post::findByTitle('Hello TinyMVC'); $post->getTitle(); $post->getPublishedAt(); // Carbon instance // persist using the entity $post->setTitle('Updated title')->save(); $post->delete(); // create using the entity factory $post = PostEntity::factory()->create(['title' => 'Hello TinyMVC']);
Entity properties are automatically hydrated from database columns (published_at becomes publishedAt) and cast to their declared types, including Carbon dates and backed enums. Columns without a matching property (from a join for example) stay available through $entity->get('column'). You can bridge both worlds at any time with $model->toEntity(Post::class), Entity::fromModel($model) and $entity->toModel().
License
Copyright
2019-2025 N'Guessan Kouadio Elisée eliseekn@gmail.com