PHPackages                             sonypradana/php-mvc - 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. [Framework](/categories/framework)
4. /
5. sonypradana/php-mvc

ActiveProject[Framework](/categories/framework)

sonypradana/php-mvc
===================

Very light php mvc, include cli easyer to creat controller view and model quikly

v2.1.0(6mo ago)2111MITPHPPHP ^8.0CI passing

Since Jan 28Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/SonyPradana/php-mvc)[ Packagist](https://packagist.org/packages/sonypradana/php-mvc)[ RSS](/packages/sonypradana-php-mvc/feed)WikiDiscussions v2.1 Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (33)Used By (0)

[![Total Downloads](https://camo.githubusercontent.com/57d1ed0737bb07c16ed4d65ff0b6a7b01a69b8e5c0b6b842b91a10364514f783/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736f6e7970726164616e612f7068702d6d7663)](https://packagist.org/packages/sonypradana/php-mvc)[![Latest Stable Version](https://camo.githubusercontent.com/e9fe72b4232d072b02d40607081981e3fbc353b0b676f4a52cbcfeeb0cc6911d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736f6e7970726164616e612f7068702d6d7663)](https://packagist.org/packages/sonypradana/php-mvc)[![License](https://camo.githubusercontent.com/0e135e29d057e7030307656846fd549dd393d9abf266dc46b9d752b6b35567b7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f736f6e7970726164616e612f7068702d6d7663)](https://packagist.org/packages/sonypradana/php-mvc)

🚀 PHP MVC Skeleton
==================

[](#-php-mvc-skeleton)

Welcome to **php-mvc**, a minimal MVC framework designed to streamline your PHP development process. This lightweight framework offers essential features for building web applications while maintaining simplicity and ease of use.

🪐 Feature
---------

[](#-feature)

- MVC structure
- Application Container (power with [php-di](https://github.com/PHP-DI/PHP-DI))
- Router Support
- Models builder
- Query builder
- CLI command
- Service Provider and Middleware
- Templator (template engine)

🎯 Quick Start (4 Steps)
-----------------------

[](#-quick-start-4-steps)

### 1️⃣ Create Your Project

[](#1️⃣-create-your-project)

```
composer create-project sonypradana/php-mvc project-name
```

### 2️⃣ Jump In

[](#2️⃣-jump-in)

```
cd project-name
```

### 3️⃣ Build Assets

[](#3️⃣-build-assets)

```
npm install
npm run build
```

### 4️⃣ Launch!

[](#4️⃣-launch)

```
php cli serve
```

**That's it!** Your app is now running. Let's build something awesome.

🎓 Building Your First Feature
-----------------------------

[](#-building-your-first-feature)

We'll create a user profile feature from scratch.

### Step 1: Create Database Schema

[](#step-1-create-database-schema)

```
php cli make:migration profiles
php cli db:create  # Only if database doesn't exist yet
```

Define your table structure:

```
// database/migration/_profiles.php
Schema::table('profiles', function (Create $column) {
    $column('user')->varChar(32);
    $column('real_name')->varChar(100);
    $column->primaryKey('user');
})
```

Run the migration:

```
php cli migrate
```

### Step 2: Generate Your Model

[](#step-2-generate-your-model)

```
php cli make:model Profile --table-name profiles
```

### Step 3: Create a Controller

[](#step-3-create-a-controller)

```
php cli make:controller Profile
```

Add your logic:

```
// app/Controller/ProfileController.php
public function index(MyPDO $pdo): Response
{
    return view('profile', [
        'name' => Profile::find('pradana', $pdo)->real_name
    ]);
}
```

### Step 4: Design Your View

[](#step-4-design-your-view)

```
php cli make:view profile
```

```
// resources/views/profile.template.php
{% extend('base/base.template.php') %}
{% section('title', 'Welcome {{ $name }}') %}

{% section('content') %}
    Hello, {{ $name }}! 👋
{% endsection %}
```

### Step 5: Register Your Route

[](#step-5-register-your-route)

```
// route/web.php
Router::get('/profile', [ProfileController::class, 'index']);
```

**Done!** Visit `/profile` and see your work in action.

🔥 Pro Move: API with Attributes
-------------------------------

[](#-pro-move-api-with-attributes)

Skip the route files entirely. Use attributes for clean, self-documented APIs:

```
php cli make:services Profile
```

```
// app/Services/ProfileServices.php
#[Get('/api/v1/profile')]
#[Name('api.v1.profile')]
#[Middleware([AuthMiddleware::class])]
public function index(MyPDO $pdo): array
{
    $data = Cache::remember('profile', 3600, fn () => [
        'name'   => Profile::find('pradana', $pdo)->real_name,
        'status' => 200,
    ]);

    return JsonResponse($data);
}
```

then register this route attribute.

```
Router::register([
    ProfileServices::class,
    // add more class
]);
```

This automatically creates your route with middleware—no extra configuration needed!

**Equivalent traditional route:**

```
Route::get('/api/v1/profile', [ProfileServices::class, 'index'])
    ->name('api.v1.profile')
    ->middleware([AuthMiddleware::class]);
```

⚡ Performance Optimization
--------------------------

[](#-performance-optimization)

Ready for production? Cache everything:

```
php cli view:cache    # Cache compiled templates
php cli config:cache  # Cache configuration
php cli route:cache   # Cache all routes
```

Your app will thank you with blazing-fast response times.

📄 License
---------

[](#-license)

Open source under the [MIT License](https://opensource.org/licenses/MIT). Build something amazing!

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance72

Regular maintenance activity

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~60 days

Recently: every ~116 days

Total

31

Last Release

124d ago

Major Versions

v0.2.x-dev → v1.0.0-beta.12023-08-14

v1.1.0 → v2.0.0-beta.12024-06-23

PHP version history (2 changes)v1.0.0-beta.1PHP ^7.4 || ^8.0

v2.0.0-beta.1PHP ^8.0

### Community

Maintainers

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

---

Top Contributors

[![SonyPradana](https://avatars.githubusercontent.com/u/7188706?v=4)](https://github.com/SonyPradana "SonyPradana (206 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sonypradana-php-mvc/health.svg)

```
[![Health](https://phpackages.com/badges/sonypradana-php-mvc/health.svg)](https://phpackages.com/packages/sonypradana-php-mvc)
```

###  Alternatives

[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M256](/packages/laravel-dusk)[doppar/framework

The Doppar Framework

366.7k8](/packages/doppar-framework)

PHPackages © 2026

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