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

ActiveLibrary[Framework](/categories/framework)

vexor/framework
===============

Vexor PHP Framework - High Performance, Ultra Secure MVC + Service Layer Framework

v1.0.0(3mo ago)071MITPHPPHP &gt;=8.2

Since Feb 19Pushed 3mo agoCompare

[ Source](https://github.com/elegancecms/vexor-framework)[ Packagist](https://packagist.org/packages/vexor/framework)[ Docs](https://github.com/elegancecms/vexor-framework)[ RSS](/packages/vexor-framework/feed)WikiDiscussions developer Synced 1w ago

READMEChangelogDependencies (1)Versions (2)Used By (1)

⚡ Vexor Framework
=================

[](#-vexor-framework)

**Vexor** — PHP 8.2+ için geliştirilmiş, performans ve güvenlik odaklı, enterprise-grade MVC + Service Layer framework.

> Laravel'in tüm gücü, fazladan ağırlık olmadan.

---

🏗️ Mimari
---------

[](#️-mimari)

```
Hybrid MVC + Service Layer
├── Controller  → HTTP işlemlerini karşılar
├── Service     → İş mantığı burada yaşar
├── Repository  → Veri erişim katmanı
└── Model       → Veritabanı temsili (ActiveRecord)

```

📁 Dizin Yapısı
--------------

[](#-dizin-yapısı)

```
vexor/
├── app/
│   ├── Controllers/     # HTTP Controller'ları
│   ├── Models/          # ORM Model'ları
│   ├── Services/        # İş mantığı servisleri
│   ├── Middleware/      # HTTP Middleware'leri
│   └── Commands/        # CLI komutları
├── config/
│   ├── app.php          # Uygulama konfigürasyonu
│   ├── database.php     # Veritabanı konfigürasyonu
│   └── auth.php         # Kimlik doğrulama konfigürasyonu
├── database/
│   ├── migrations/      # Veritabanı migration'ları
│   └── seeds/           # Test verisi
├── public/
│   └── index.php        # HTTP giriş noktası
├── routes/
│   ├── web.php          # Web route'ları (CSRF korumalı)
│   └── api.php          # API route'ları (JWT/API Key)
├── src/
│   └── Core/            # Framework çekirdeği
├── storage/
│   ├── logs/            # Log dosyaları
│   └── cache/           # Cache dosyaları
└── vexor                # CLI aracı

```

---

🚀 Kurulum
---------

[](#-kurulum)

```
# Composer bağımlılıklarını yükle
composer install

# .env dosyasını oluştur
cp .env.example .env

# Uygulama anahtarı oluştur
php vexor key:generate

# Geliştirme sunucusunu başlat
php vexor serve
```

---

🛣️ Router
---------

[](#️-router)

```
// Temel route'lar
$router->get('/users', 'UserController@index');
$router->post('/users', 'UserController@store');
$router->put('/users/{id}', 'UserController@update');
$router->delete('/users/{id}', 'UserController@destroy');

// Closure route
$router->get('/ping', function(Request $request): Response {
    return Response::json(['pong' => true]);
});

// Named route
$router->get('/profile', 'ProfileController@show')->name('profile');

// Route grubu
$router->prefix('/admin')->middleware('auth')->group(function($r) {
    $r->get('/dashboard', 'AdminController@dashboard');
});

// RESTful resource (tam CRUD)
$router->resource('posts', PostController::class);

// API resource (sadece index, show, store, update, destroy)
$router->apiResource('posts', PostController::class);
```

---

🎮 Controller
------------

[](#-controller)

```
class UserController extends Controller
{
    public function index(Request $request): Response
    {
        // Input alma (XSS korumalı)
        $search = $request->safe('search');

        return $this->json(['users' => []]);
    }

    public function store(Request $request): Response
    {
        // Validation
        $data = $this->validate($request, [
            'name'     => 'required|min:2|max:100',
            'email'    => 'required|email',
            'password' => 'required|min:8|confirmed',
        ]);

        $data['password'] = $this->security()->hashPassword($data['password']);
        $user = User::create($data);

        return $this->success($user->toArray(), 'User created.', 201);
    }
}
```

---

🗄️ ORM / QueryBuilder
---------------------

[](#️-orm--querybuilder)

```
// Fluent QueryBuilder — hazırlanmış ifadeler, SQL injection imkansız
$users = User::query()
    ->where('is_active', true)
    ->whereLike('name', '%john%')
    ->whereIn('role', ['admin', 'editor'])
    ->orderBy('created_at', 'DESC')
    ->limit(10)
    ->get();

// ActiveRecord
$user = User::find(1);
$user->name = 'Jane';
$user->save();

// İlişkiler
class Post extends Model {
    public function author() { return $this->belongsTo(User::class, 'user_id'); }
    public function comments() { return $this->hasMany(Comment::class, 'post_id'); }
}

// Toplu işlemler
User::where('is_active', false)->delete();

// Transaction
DB::transaction(function ($db) {
    $db->table('accounts')->where('id', 1)->decrement('balance', 100);
    $db->table('accounts')->where('id', 2)->increment('balance', 100);
});

// Sayfalama
$users = User::query()->paginate(15, $page);
// ['data' => [...], 'total' => 100, 'per_page' => 15, 'last_page' => 7]
```

---

🔐 Güvenlik
----------

[](#-güvenlik)

### CSRF Koruması

[](#csrf-koruması)

```
// View'da

// Manuel kontrol
security()->validateCsrf($request);
```

### XSS Koruması

[](#xss-koruması)

```
// Output encoding
e($user->name)                   // HTML context
security()->escape($val, 'js')   // JS context
security()->purify($html)        // HTML sanitize
```

### Rate Limiting

[](#rate-limiting)

```
// Route bazlı
$router->middleware('RateLimitMiddleware')->group(...);

// Manuel
if (!security()->rateLimit('login:' . $ip, 5, 60)) {
    abort(429, 'Too many attempts.');
}
```

### Şifreleme

[](#şifreleme)

```
$encrypted = security()->encrypt('gizli veri');
$decrypted = security()->decrypt($encrypted);
```

### Argon2id ile Şifre

[](#argon2id-ile-şifre)

```
$hash = security()->hashPassword('password123');
$ok   = security()->verifyPassword('password123', $hash);
```

---

🔑 Authentication
----------------

[](#-authentication)

### Session Auth (Web)

[](#session-auth-web)

```
// Giriş
$success = auth()->attempt(['email' => 'a@b.com', 'password' => '...']);

// Oturumu kapat
auth()->logout();

// Mevcut kullanıcı
$user = auth()->user();
if (auth()->check()) { ... }
```

### JWT Auth (API)

[](#jwt-auth-api)

```
// Token oluştur
$token = auth()->generateJwt($user, ttl: 3600);

// İstemci: Authorization: Bearer {token}
// Vexor otomatik doğrular
```

### API Key

[](#api-key)

```
// Key oluştur
$key = security()->generateApiKey('myapp');

// İstemci: X-API-Key: {key} veya ?api_key={key}
// Vexor otomatik doğrular
```

---

📱 2FA (TOTP)
------------

[](#-2fa-totp)

```
// Secret oluştur
$secret = security()->generate2FASecret();

// Kod doğrula (Google Authenticator vb.)
$valid = security()->verifyTotp($secret, $inputCode);
```

---

⚡ CLI (Vexor Konsol)
--------------------

[](#-cli-vexor-konsol)

```
# Tüm komutları gör
php vexor

# Model oluştur
php vexor make:model Post --migration

# Controller oluştur
php vexor make:controller PostController --api

# Middleware oluştur
php vexor make:middleware RoleMiddleware

# Migration oluştur
php vexor make:migration create_posts_table

# Migration çalıştır
php vexor migrate

# Route listesi
php vexor route:list

# Geliştirme sunucusu
php vexor serve --port=9000

# Cache temizle
php vexor cache:clear
```

### Özel Komut Yazma

[](#özel-komut-yazma)

```
class SendEmailsCommand extends Command
{
    public function getName(): string        { return 'emails:send'; }
    public function getDescription(): string { return 'Send pending emails'; }

    public function execute(Input $input, Console $console): int
    {
        $limit = $input->option('limit', 100);
        $this->info("Sending up to {$limit} emails...");

        // İş mantığı burada
        $this->success('Done!');
        return 0;
    }
}
```

---

🧩 Middleware
------------

[](#-middleware)

```
class RoleMiddleware implements MiddlewareInterface
{
    public function handle(Request $request, Closure $next): Response
    {
        $user = $request->getAttribute('user');

        if (!$user?->isAdmin()) {
            return Response::json(['error' => 'Forbidden'], 403);
        }

        return $next($request);
    }
}
```

---

🛡️ Güvenlik Özellikleri Özeti
-----------------------------

[](#️-güvenlik-özellikleri-özeti)

ÖzellikDurumCSRF Token✅ Her POST/PUT/PATCH/DELETEXSS Output Encoding✅ Çok bağlamlı (html/js/url/css)SQL Injection✅ Sadece Prepared StatementsSQL Injection Tespiti✅ Pattern matching + engellemeRate Limiting✅ Token bucket, IP bazlıArgon2id Şifreleme✅ Otomatik rehashAES-256-GCM Şifreleme✅ GCM Auth Tag ileJWT Auth✅ HS256, exp kontrolüAPI Key✅ SHA-256 hashlenmiş saklama2FA TOTP✅ RFC 6238 uyumluGüvenli Cookie✅ HttpOnly, Secure, SameSite=StrictGüvenli Session✅ Regenerate, Strict SameSiteHTTP Güvenlik Başlıkları✅ CSP, HSTS, X-Frame vb.Hata Gizleme (Prod)✅ Detay sadece debug moddaGüvenlik Logu✅ Tüm ihlaller kayıt altında---

⚙️ Gereksinimler
----------------

[](#️-gereksinimler)

- PHP 8.2+
- ext-pdo, ext-json, ext-mbstring, ext-openssl
- Composer

---

*Vexor Framework — Hız ve güvenlik, ödün vermeden.*

vexor-framework
===============

[](#vexor-framework)

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance79

Regular maintenance activity

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

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

110d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1344162358b09ab039c278bba261229279e864efe9fa8f4824df0a6e5bc617ff?d=identicon)[elegancecms](/maintainers/elegancecms)

---

Top Contributors

[![elegancecms](https://avatars.githubusercontent.com/u/74207345?v=4)](https://github.com/elegancecms "elegancecms (6 commits)")

---

Tags

phpjwtframeworkormmvcsecure

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[phpmv/ubiquity

Ubiquity-framework

70139.3k6](/packages/phpmv-ubiquity)[letsdrink/ouzo

Ouzo PHP MVC framework

7210.7k1](/packages/letsdrink-ouzo)[zemit-cms/core

Build Phalcon REST APIs faster with database-first scaffolding, model relationships, eager loading, identity, permissions, CLI, and WebSocket support.

138.5k1](/packages/zemit-cms-core)[mirekmarek/php-jet

PHP Jet is modern, powerful, real-life proven, really fast and secure, small and light-weight framework for PHP8 with great clean and flexible modular architecture containing awesome developing tools. No magic, just clean software engineering.

241.3k](/packages/mirekmarek-php-jet)

PHPackages © 2026

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