PHPackages                             devmboo/monolog - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. devmboo/monolog

ActiveProject[Logging &amp; Monitoring](/categories/logging)

devmboo/monolog
===============

A simple and efficient web application framework for rapid development.

V1.0.0(1y ago)219GPL-3.0-or-laterPHPPHP &gt;=8.0

Since Mar 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/DevMboo/monolog)[ Packagist](https://packagist.org/packages/devmboo/monolog)[ RSS](/packages/devmboo-monolog/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Monolog PHP Framework 🎤
=======================

[](#monolog-php-framework-)

Welcome to **Monolog**, a custom PHP framework for building modern and dynamic web applications. This framework is designed to be simple, flexible, and efficient for both small and large projects.

---

🛠️ Framework Overview
---------------------

[](#️-framework-overview)

**Monolog** is a PHP framework that streamlines the development process by providing easy-to-use CLI commands, project scaffolding, and environment configurations. It helps you quickly build out essential features like controllers, models, migrations, views, and more.

It was built using PHP 8.3.x and relies on **Composer** for dependency management.

---

🗂️ Project Structure
--------------------

[](#️-project-structure)

Here's a breakdown of the directory structure in the **Monolog** project:

- **`/src`**: Contains the main source files for the framework.

    - **`/app`**: Core application files.
        - **`/config`**: Configuration files (e.g., `stacking.php`).
        - **`/console/commands`**: Holds all the custom CLI commands.
            - `MakeComponent.php`
            - `MakeController.php`
            - `MakeLayout.php`
            - `MakeMigrate.php`
            - `MakeMiddleware.php`
            - `MakeMigration.php`
            - `MakeModel.php`
            - `MakeSeeder.php`
            - `MakeView.php`
            - `ServerCommand.php`
        - **`/controller`**: Contains controller files.
            - `Controller.php`
        - **`/helpers`**: Helper files for different purposes.
            - **`/common`**: Common helpers like `env.php`.
            - **`/database`**: Helpers related to database, e.g., `Migration.php`.
            - **`/environment`**: Environment helpers like `Env.php`.
        - **`/http`**: HTTP-related files such as requests and responses.
            - `Request.php`
            - `Response.php`
            - `Router.php`
        - **`/middlewares`**: Middleware files for API and Web.
            - **`/api`**: API-related middlewares.
                - `EnsureApplicationJWT.php`
            - **`/web`**: Web-related middlewares.
                - `EnsureApplicationActive.php`
                - `EnsureApplicationCrsfToken.php`
                - `EnsureAutenticateSessionUser.php`
        - **`/resources`**: Resource files like views and components.
            - **`Component.php`**
            - **`View.php`**
            - **`/views`**: Views of the application.
                - `public.html`
        - **`/database`**: Database-related files.
            - **`Database.php`**
            - **`/migrations`**: Migration files for the database schema.
                - `2025_03_04_01_52_03_create_migrations_table.php`
            - **`/seeders`**: Database seeding files.
        - **`/model`**: Contains model files.
            - `Model.php`
        - **`/router`**: Contains routing files.
            - `web.php`
        - **`/view`**: Stores view files for the application.
            - **`/public`**: Public assets like CSS, images, and JS.
                - **`/css`**
                - **`/ico`**
                - **`/images`**
                - **`/js`**
            - **`/resources`**: Stores additional resource files.
                - **`/views`**: Stores view files.
                    - `app.html`
                    - **`/components`**: Individual components like `banner.html`.
                    - **`/pages`**: Static page views like `home.html`.
- **`/vendor`**: Composer dependencies and autoload files.

    - `autoload.php`
    - **`/composer`**: Composer-specific files.
        - `autoload_classmap.php`
        - `autoload_namespaces.php`
        - `autoload_psr4.php`
        - `autoload_real.php`
        - `autoload_static.php`
        - `ClassLoader.php`
        - `installed.json`
        - `installed.php`
        - `InstalledVersions.php`
        - `LICENSE`
        - `platform_check.php`
- **`/resources`**: Stores resources like layouts, static views, and the environment file (`.env`).
- **`/node_modules`**: Contains the installed NPM packages for front-end development, including Tailwind CSS.

---

📋 Features
----------

[](#-features)

- **Custom CLI commands**: Automate repetitive tasks such as creating controllers, models, migrations, views, etc.
- **Simple and clean structure**: Based on the MVC pattern to promote scalability and maintainability.
- **Environment configuration**: Using `.env` files to manage environment variables for different environments (e.g., development, production).
- **Tailwind CSS Integration**: Easily configure Tailwind for front-end styling.

---

⚙️ Installation &amp; Setup
---------------------------

[](#️-installation--setup)

To get started with **Monolog**, follow these steps:

### 1. Install project CLI

[](#1-install-project-cli)

```
composer require devmboo/monolog
```

### 2. Navigate to the project directory

[](#2-navigate-to-the-project-directory)

```
cd your-project-directory
```

### 3. Install dependencies using Composer

[](#3-install-dependencies-using-composer)

Ensure that you have [Composer](https://getcomposer.org/) installed. If you don't have it, you can install it by following the instructions on the official website.

```
composer install
```

This will install all the required dependencies for the project.

### 4. Install front-end dependencies (Tailwind CSS)

[](#4-install-front-end-dependencies-tailwind-css)

Monolog uses Tailwind CSS for styling. To install the required NPM packages, run the following:

```
npm install
```

This will install Tailwind and other necessary front-end dependencies.

### 5. Configure the `.env` file

[](#5-configure-the-env-file)

Rename the `.env.example` file to `.env` and fill in the necessary configuration details:

```
#### APPLICATION ####
APP_KEY=
APP_LOCAL=homolog
APP_URL=http://localhost
APP_NAME=monolog
APP_PORT=8000

#### DATABASE ####
DB_DRIVER=YOUR_DRIVER
DB_HOST=YOUR_HOST
DB_NAME=YOUR_DB_NAME
DB_USER=YOUR_USER
DB_PASSWORD=YOUR_PASSWORD
DB_PORT=YOUR_PORT

#### SUPPORT MODE ####
STANDARD_MODE=false

#### ENCRYPTY KEY ####
ENCRYPT=

#### MAILER SETTINGS ####
MAIL_DRIVER=smtp
MAIL_HOST=smtp.example.com
MAIL_PORT=587
MAIL_USERNAME=your_email@example.com
MAIL_PASSWORD=your_email_password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=no-reply@example.com
MAIL_FROM_NAME="Monolog System"

```

### 6. Build the front-end assets

[](#6-build-the-front-end-assets)

Once NPM packages are installed, you can build the front-end assets by running:

```
npm run dev
```

This will compile your assets, including Tailwind CSS, and make them ready for use.

### 7. Start the development server

[](#7-start-the-development-server)

Use the following command to start the server:

```
php mono.php server
```

This command will launch the built-in PHP server using the port defined in your `.env` file. By default, it uses port `8000`.

### 8. Create layouts and other components

[](#8-create-layouts-and-other-components)

You can create layouts, controllers, models, migrations, and other components using the following commands:

- **Create a new layout**:

```
php mono.php make:layout
```

- **Create a new controller**:

```
php mono.php make:controller
```

- **Create a new model**:

```
php mono.php make:model
```

- **Create a new migration**:

```
php mono.php make:migration
```

- **Create a new view**:

```
php mono.php make:view
```

- **Create a new seeder**:

```
php mono.php make:seeder
```

---

🚀 How to Code
-------------

[](#-how-to-code)

1. **Controllers**: Store your controllers in the `/src/app/controllers` directory. You can generate them using the `make:controller` command.
2. **Models**: Create models in `/src/app/models`. Use the `make:model` command for automatic generation.
3. **Migrations**: Define your database structure using migrations. Generate them with `make:migration`.
4. **Views**: All views are stored in `/resources/views`. You can create views with `make:view` or create layouts that are used globally.
5. **Layouts**: Use layouts for structuring the HTML template of your application. These can be created using the `make:layout` command.

You can easily extend and modify any part of this framework to meet your project's needs.

---

🔧 Available CLI Commands
------------------------

[](#-available-cli-commands)

Here’s a list of the available commands:

CommandDescription`php mono.php server`Starts the built-in PHP server.`php mono.php standard`Disables the application.`php mono.php make:controller `Creates a new controller.`php mono.php make:model `Creates a new model.`php mono.php make:migration `Creates a new migration file.`php mono.php make:middleware `Creates a new middleware file.`php mono.php make:seeder `Creates a new seeder.`php mono.php make:view `Creates a new view file.`php mono.php make:layout `Creates a new layout template.`php mono.php make:component `Creates a new component file.`php mono.php make:mail `Creates a new mail layout file template.`php mono.php make:seed`Executes all seeder classes to insert initial data into the database.`php mono.php make:migrate`Executes all pending migrations in the database.---

📄 License
---------

[](#-license)

This project is open source and available under the [MIT License](LICENSE).

---

### 🔑 **Documentation Summary**

[](#-documentation-summary)

MethodDescription`handle()`Orchestrates the application's initialization, including environment loading, request capturing, and route dispatching.---

Monolog - Basic CRUD Example
============================

[](#monolog---basic-crud-example)

Introduction
------------

[](#introduction)

This document provides a basic implementation of a CRUD (Create, Read, Update, Delete) system for a `User` model using the `Model` class. The `User` model extends `Model`, leveraging its built-in database methods.

Prerequisites
-------------

[](#prerequisites)

- PHP 8+
- PDO Extension enabled
- A properly configured database connection

User Model Implementation
-------------------------

[](#user-model-implementation)

Create a `User` model that extends `Model` use cli php mono.php make:model :

```
class User extends Model {
    protected string $tbname = 'users';
}
```

CRUD Operations
---------------

[](#crud-operations)

### 1. Create a User

[](#1-create-a-user)

```
$user = new User();
$created = $user->create([
    'name' => 'John Doe',
    'email' => 'john.doe@example.com',
    'password' => password_hash('secret', PASSWORD_BCRYPT)
]);

if ($created) {
    echo "User created successfully!";
}
```

### 2. Retrieve All Users

[](#2-retrieve-all-users)

```
$user = new User();
$users = $user->all();
print_r($users);
```

### 3. Find a User by ID

[](#3-find-a-user-by-id)

```
$user = new User();
$foundUser = $user->find(1);
print_r($foundUser);
```

### 4. Update a User

[](#4-update-a-user)

```
$user = new User();
$updated = $user->update(1, [
    'name' => 'John Updated',
    'email' => 'john.updated@example.com'
]);

if ($updated) {
    echo "User updated successfully!";
}
```

### 5. Delete a User

[](#5-delete-a-user)

```
$user = new User();
$deleted = $user->delete(1);

if ($deleted) {
    echo "User deleted successfully!";
}
```

Conclusion
----------

[](#conclusion)

This example demonstrates how to implement a basic CRUD system using the `Model` class. You can extend this functionality by adding additional methods and refining validations.

---

/\*\*

- Monolog PHP Framework.
- Version 1.0 (2025).
-
- Monolog is a fresh take on project structure, inspired by Laravel and CodeIgniter 4.
- It aims to provide a clean, efficient, and developer-friendly architecture.
-
- @see  The Monolog GitHub repository
-
- @author Luan Chaves
- @copyright 2025 Luan Chaves
- @license  MIT License
- @note This framework is distributed in the hope that it will be useful,
- ```
           but WITHOUT ANY WARRANTY; without even the implied warranty of

    ```
- ```
           MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    ```

\*/

---

💬 Questions?
------------

[](#-questions)

Feel free to open an issue or ask questions through our discussion board. Happy coding! 😊

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance45

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

429d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/121dc025b07a8b5552d94d7018fc8c773da5939683ca4c2785eec147fa105eef?d=identicon)[DevMboo](/maintainers/DevMboo)

---

Top Contributors

[![DevMboo](https://avatars.githubusercontent.com/u/76760576?v=4)](https://github.com/DevMboo "DevMboo (33 commits)")

---

Tags

clean-codeframeworkframework-phpphpphp8quickstart

### Embed Badge

![Health badge](/badges/devmboo-monolog/health.svg)

```
[![Health](https://phpackages.com/badges/devmboo-monolog/health.svg)](https://phpackages.com/packages/devmboo-monolog)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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