PHPackages                             ayouberrak/ayoub-framework - 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. ayouberrak/ayoub-framework

ActiveProject[Framework](/categories/framework)

ayouberrak/ayoub-framework
==========================

Lightweight PHP MVC Framework

v1.4.0(4mo ago)04PHPPHP ^8.2

Since Jan 18Pushed 4mo agoCompare

[ Source](https://github.com/ayouberrak/my-fr)[ Packagist](https://packagist.org/packages/ayouberrak/ayoub-framework)[ RSS](/packages/ayouberrak-ayoub-framework/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (9)Used By (0)

Ayoub Framework 🚀
=================

[](#ayoub-framework-)

A lightweight, robust, and modern PHP MVC framework designed for speed and simplicity. Built with a "Nadi" (Premium) philosophy.

✨ Features
----------

[](#-features)

- **MVC Architecture**: Clean separation of Models, Views, and Controllers.
- **Custom CLI (`ayoub`)**: Powerful command-line interface for scaffolding.
- **Dynamic Routing**: Supports static routes and dynamic parameters (e.g., `/user/{id}`).
- **Database Agnostic**: Native PDO support for MySQL and PostgreSQL.
- **Pretty Error Handling**: Integrated `Whoops` for beautiful debugging.
- **Modern UI**: Includes premium, glassmorphism-styled default views.

📦 Installation
--------------

[](#-installation)

1. **Create a new project via Composer:**

    ```
    composer create-project ayouberrak/ayoub-framework my-app
    cd my-app
    ```
2. **Configure Environment:**Copy the example env file and configure your database.

    ```
    cp .env.example .env
    ```

    *Edit `.env` to set `DB_CONNECTION`, `DB_HOST`, `DB_DATABASE`, etc.*
3. **Run the Server:**

    ```
    php ayoub run
    ```

🛠️ CLI Commands (`php ayoub`)
-----------------------------

[](#️-cli-commands-php-ayoub)

The framework comes with a powerful CLI tool named `ayoub` to speed up your development.

### 🚀 Server Commands

[](#-server-commands)

#### Start Development Server

[](#start-development-server)

Start the built-in PHP development server.

```
php ayoub run
```

*Starts server on *

**Custom Port:**

```
php ayoub run 3000
```

*Starts server on *

---

### 📝 Scaffolding Commands

[](#-scaffolding-commands)

#### Make Controller

[](#make-controller)

Generate a new controller class.

```
php ayoub make:controller UserController
```

*Creates: `app/Controllers/UserController.php`*

**Example:**

```
php ayoub make:controller ProductController
```

#### Make Model

[](#make-model)

Generate a new database model.

```
php ayoub make:model Product
```

*Creates: `app/Models/Product.php`*

**Example:**

```
php ayoub make:model User
```

#### Make Service

[](#make-service)

Generate a business logic service.

```
php ayoub make:service PaymentService
```

*Creates: `app/Services/PaymentService.php`*

**Example:**

```
php ayoub make:service AuthService
```

#### Make Repository

[](#make-repository)

Generate a data repository.

```
php ayoub make:repository OrderRepository
```

*Creates: `app/Repositories/OrderRepository.php`*

**Example:**

```
php ayoub make:repository UserRepository
```

> **💡 Tip:** Suffixes are optional! `php ayoub make:controller User` will automatically generate `UserController`.

---

### 🛣️ Route Commands

[](#️-route-commands)

#### Make Route

[](#make-route)

Generate a new route and append it to `routes/web.php`.

```
php ayoub make:route
```

**Examples:**

```
# GET route
php ayoub make:route get /users UserController@index

# POST route
php ayoub make:route post /users/create UserController@store

# Dynamic route
php ayoub make:route get /users/{id} UserController@show

# DELETE route
php ayoub make:route delete /users/{id} UserController@destroy
```

#### List All Routes

[](#list-all-routes)

Display all registered routes in your application.

```
php ayoub route:list
```

**Output Example:**

```
Registered Routes:
METHOD    URI                          ACTION
------------------------------------------------------------
GET       /                            Closure
GET       /users                       UserController@index
POST      /users                       UserController@store
GET       /users/{id}                  UserController@show

```

---

### 📋 All Commands Summary

[](#-all-commands-summary)

CommandDescriptionExample`run [port]`Start development server`php ayoub run 8000``make:controller `Create a controller`php ayoub make:controller UserController``make:model `Create a model`php ayoub make:model Product``make:service `Create a service`php ayoub make:service AuthService``make:repository `Create a repository`php ayoub make:repository UserRepository``make:route   `Create a route`php ayoub make:route get /users UserController@index``route:list`List all routes`php ayoub route:list`🛣️ Routing
----------

[](#️-routing)

Define your routes in `routes/web.php`.

**Static Route:**

```
$router->get('/about', [PageController::class, 'about']);
```

**Dynamic Route:**

```
// The {id} will be passed to the controller method
$router->get('/user/{id}', [UserController::class, 'show']);
```

**View Rendering:**

```
$router->get('/', function() use ($router) {
    return $router->renderView('welcome');
});
```

📂 Structure
-----------

[](#-structure)

- `app/` - Core logic (Controllers, Models, Services).
- `public/` - Entry point (`index.php`).
- `routes/` - Route definitions.
- `views/` - HTML templates.
- `config/` - Configuration files.

---

*Built with ❤️ by Ayoub.*

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance78

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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 ~0 days

Total

8

Last Release

120d ago

### Community

Maintainers

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

---

Top Contributors

[![ayouberrak](https://avatars.githubusercontent.com/u/228095486?v=4)](https://github.com/ayouberrak "ayouberrak (44 commits)")

### Embed Badge

![Health badge](/badges/ayouberrak-ayoub-framework/health.svg)

```
[![Health](https://phpackages.com/badges/ayouberrak-ayoub-framework/health.svg)](https://phpackages.com/packages/ayouberrak-ayoub-framework)
```

###  Alternatives

[doppar/framework

The Doppar Framework

366.7k8](/packages/doppar-framework)

PHPackages © 2026

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