承接 ayouberrak/ayoub-framework 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ayouberrak/ayoub-framework

最新稳定版本:v1.4.0

Composer 安装命令:

composer create-project ayouberrak/ayoub-framework

包简介

Lightweight PHP MVC Framework

README 文档

README

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

✨ 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

  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)

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

🚀 Server Commands

Start Development Server

Start the built-in PHP development server.

php ayoub run

Starts server on http://localhost:8000

Custom Port:

php ayoub run 3000

Starts server on http://localhost:3000

📝 Scaffolding Commands

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

Generate a new database model.

php ayoub make:model Product

Creates: app/Models/Product.php

Example:

php ayoub make:model User

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

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

Make Route

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

php ayoub make:route <method> <uri> <controller@action>

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

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

Command Description Example
run [port] Start development server php ayoub run 8000
make:controller <Name> Create a controller php ayoub make:controller UserController
make:model <Name> Create a model php ayoub make:model Product
make:service <Name> Create a service php ayoub make:service AuthService
make:repository <Name> Create a repository php ayoub make:repository UserRepository
make:route <method> <uri> <action> Create a route php ayoub make:route get /users UserController@index
route:list List all routes php ayoub route:list

🛣️ 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

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

Built with ❤️ by Ayoub.

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2026-01-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固