PHPackages                             yabasi/yabasi - 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. yabasi/yabasi

ActiveProject[Framework](/categories/framework)

yabasi/yabasi
=============

A powerful, flexible, and modern PHP framework designed for rapid application development

v1.0.16(1y ago)5161MITTwig

Since Oct 20Pushed 1y ago2 watchersCompare

[ Source](https://github.com/yabasi/yabasi)[ Packagist](https://packagist.org/packages/yabasi/yabasi)[ Fund](https://www.buymeacoffee.com/yabasi)[ GitHub Sponsors](https://github.com/yabasi)[ RSS](/packages/yabasi-yabasi/feed)WikiDiscussions main Synced 1mo ago

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

Yabasi Framework
================

[](#yabasi-framework)

Yabasi is a cutting-edge, high-performance PHP framework designed for modern web application development. Built with scalability, flexibility, and developer productivity in mind, Yabasi provides a robust foundation for creating efficient and maintainable web applications.

Our framework stands out with its innovative approach to solving common web development challenges, offering a unique blend of performance optimization, intuitive APIs, and comprehensive features. Yabasi empowers developers to build sophisticated applications with ease, without compromising on speed or code quality.

 [![Latest Stable Version](https://camo.githubusercontent.com/b4adecb5910644d3a207d1d53265dab36c5705ac04eba04d50a32ba39774b939/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7961626173692f6672616d65776f726b2e737667)](https://packagist.org/packages/yabasi/framework) [![Total Downloads](https://camo.githubusercontent.com/e8d80111bc4765b257ceaccfa0e8ee1cf9b017123fa90c2f0b7cc206de2e3a9c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7961626173692f6672616d65776f726b2e737667)](https://packagist.org/packages/yabasi/framework) [![License](https://camo.githubusercontent.com/baa1be036f106d72d126ccadb6bffc857aef6e6779abcea075c47beff09a1c4c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7961626173692f6672616d65776f726b2e737667)](https://github.com/yabasi/framework/blob/main/LICENSE)

Features
--------

[](#features)

- **Fast Routing**: Powerful and flexible route management for efficient request handling.
- **Dependency Injection**: Robust container for managing class dependencies and performing dependency injection.
- **ORM Support**: Intuitive Object-Relational Mapping for seamless database operations.
- **Twig Integration**: Flexible and secure template engine for easy view rendering.
- **CLI Support**: Built-in console component for creating powerful command-line applications.
- **Middleware System**: Customizable middleware pipeline for request/response processing.
- **Event Dispatcher**: Flexible event handling and dispatching system for extending application functionality.
- **Caching**: Advanced caching mechanisms to optimize application performance.
- **Security Features**: Built-in security features including CSRF protection and XSS prevention.
- **Database Migrations**: Version control system for your database schema.
- **Validation**: Comprehensive data validation system for forms and input processing.
- **Logging**: Integrated logging system for debugging and monitoring application behavior.
- **Model Relationships**: Support for complex database relationships including One-to-One, One-to-Many, and Many-to-Many.
- **Query Builder**: Fluent interface for constructing database queries.
- **Database Seeding**: Easily populate your database with test data.
- **Asset Management**: Built-in asset manager for handling CSS and JavaScript files.
- **Localization**: Multi-language support for creating multilingual applications.
- **Configuration Management**: Flexible configuration system with environment-specific settings.
- **Error Handling**: Comprehensive error and exception handling system.
- **WebSocket Support**: Built-in WebSocket server for real-time communication.
- **Service Providers**: Modular system for bootstrapping and configuring application services.
- **Filesystem Abstraction**: Unified API for working with local and cloud file storage systems.
- **Form Requests**: Dedicated classes for handling form input and validation.
- **Database Dump and Restore**: Built-in commands for database backup and restoration.
- **Model Factories**: Generate test data easily with model factories.
- **API Development Tools**: Built-in support for API development including rate limiting and versioning.
- **Session Management**: Secure and flexible session handling.
- **Database Query Logging**: Log and analyze database queries for performance optimization.
- **Custom Artisan Commands**: Easily create custom CLI commands for your application.
- **Eager Loading**: Optimize database queries with eager loading of relationships.
- **Database Transactions**: Support for database transactions to ensure data integrity.
- **Request Lifecycle**: Well-defined request lifecycle for precise control over application flow.
- **Environment Detection**: Automatically detect and configure for different environments (development, production, etc.).
- **Pagination**: Built-in pagination support for large datasets.
- **Rate Limiting**: Protect your application from abuse with configurable rate limiting.
- **Database Connection Pooling**: Efficient management of database connections for improved performance.
- **Custom Validation Rules**: Easily extend the validation system with custom rules.
- **Model Events**: Hook into model lifecycle events for complex operations.
- **Database Schema Builder**: Programmatically define and modify database schema.
- **Robust HTTP Client**: Built-in HTTP client for making external API requests.
- **Redis Integration**: Built-in support for Redis, allowing for efficient caching, queues, and real-time features.
- **Queue System**: Robust job queue system for handling time-consuming tasks asynchronously, improving application responsiveness.
- **CORS Support**: Built-in Cross-Origin Resource Sharing (CORS) middleware for API security.
- **Auto-loading**: PSR-4 compliant auto-loading for efficient class loading.
- **Database Query Caching**: Automatic caching of database query results for improved performance.
- **Advanced ORM**: Intuitive and powerful Object-Relational Mapping system for elegant database interactions.
- **Flexible Templating Engine**: Feature-rich templating engine with custom extensions for efficient view rendering.
- **Application Events**: Pre-defined application events for hooking into the framework's lifecycle.
- **Dependency Graph**: Visualization tools for application's dependency graph.
- **Robust Testing Suite**: Comprehensive testing utilities for unit, integration, and feature testing.
- **Database Connection Abstraction**: Support for multiple database systems with a unified interface.

Installation
------------

[](#installation)

You can create a new Yabasi Framework project using Composer:

```
composer create-project yabasi/yabasi myproject
cd myproject
```

This will create a new Yabasi project in the `myproject` directory. The project comes with a pre-configured application structure and all necessary dependencies. If you want to add Yabasi Framework to an existing project, you can use:

```
composer require yabasi/framework
```

After installation, you'll need to set up your environment configuration and potentially run some initialization commands. Refer to the Configuration section for more details.

Usage
=====

[](#usage)

Routing
-------

[](#routing)

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

```
$router->get('/', function() {
    return 'Hello Yabasi!';
});

$router->get('/users/{id}', 'UserController@show');

$router->group(['middleware' => [\Yabasi\Middleware\SessionMiddleware::class]], function ($router) {
   $router->get('/account', 'AccountController@index');
   $router->post('/account/update', 'AccountController@update');
});
```

Controllers
-----------

[](#controllers)

Create a controller in `app/Controllers`:

```
namespace App\Controllers;

use Yabasi\Http\Request;
use Yabasi\Http\Response;

class UserController extends Controller
{
    public function show(Request $request, $id)
    {
        $user = User::find($id);
        return $this->view('users.show', ['user' => $user]);
    }
}
```

ORM
---

[](#orm)

Interact with your database using the ORM:

```
// Define a model
class User extends Model
{
    protected static string $table = 'users';

    public function posts()
    {
        return $this->hasMany(Post::class);
    }
}

// Retrieve all users
$users = User::all();

// Find a specific user
$user = User::find(1);

// Create a new user
$user = new User();
$user->name = 'John Doe';
$user->email = 'john@example.com';
$user->save();

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

// Delete a user
$user = User::find(1);
$user->delete();

// Query building
$users = User::where('active', true)
             ->orderBy('name', 'asc')
             ->limit(10)
             ->get();

// Relationships
$user = User::find(1);
$posts = $user->posts;
```

Middleware
----------

[](#middleware)

Create a middleware in `app/Middleware`:

```
namespace App\Middleware;

use Closure;
use Yabasi\Http\Request;
use Yabasi\Http\Response;

class AuthMiddleware implements MiddlewareInterface
{
    public function handle(Request $request, Closure $next): Response
    {
        if (!$request->session->has('user_id')) {
            return redirect('/login');
        }
        return $next($request);
    }
}
```

CLI Commands
------------

[](#cli-commands)

Create a custom CLI command:

```
namespace App\Commands;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class GenerateReportCommand extends Command
{
    protected static $defaultName = 'app:generate-report';

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('Generating report...');
        // Report generation logic here
        $output->writeln('Report generated successfully!');
        return Command::SUCCESS;
    }
}
```

Run the command:

```
php yabasi app:generate-report
```

Service Providers
-----------------

[](#service-providers)

Create a service provider in `app/Providers`:

```
namespace App\Providers;

use Yabasi\ServiceProvider\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    public function register(): void
    {
        $this->container->singleton(MyService::class, function ($container) {
            return new MyService($container->get(DependencyClass::class));
        });
    }

    public function boot(): void
    {
        // Boot logic here
    }
}
```

Localization
------------

[](#localization)

Set up localization files in `resources/lang/`:

```
// storage/lang/en.json
return [
    'welcome' => 'Welcome to our application!',
    'goodbye' => 'Goodbye, see you soon!',
];

// resources/lang/es.json
return [
    'welcome' => '¡Bienvenido a nuestra aplicación!',
    'goodbye' => '¡Adiós, hasta pronto!',
];
```

Use translations in your code:

```
echo __('messages.welcome');
```

Validation
----------

[](#validation)

Validate input data:

```
$validator = new Validator($request->all(), [
    'name' => 'required|string|max:255',
    'email' => 'required|email|unique:users',
    'password' => 'required|min:8|confirmed',
]);

if ($validator->fails()) {
    return redirect()->back()->withErrors($validator);
}
```

Caching
-------

[](#caching)

Use the caching system:

```
// Set a value in the cache
Cache::set('key', 'value', 3600);

// Get a value from the cache
$value = Cache::get('key', 'default');

// Remove a value from the cache
Cache::delete('key');

// Check if a key exists in the cache
if (Cache::has('key')) {
    // ...
}
```

Events
------

[](#events)

Dispatch and listen for events:

```
// Dispatch an event
$dispatcher = new EventDispatcher();
$dispatcher->dispatch(new UserRegisteredEvent($user));

// Listen for an event
$dispatcher->listen(UserRegisteredEvent::class, function($event) {
    // Handle the event
});
```

Database Migrations
-------------------

[](#database-migrations)

Create a migration:

```
php yabasi make:migration create_users_table
```

Define the migration:

```
use Yabasi\Database\Connection;
use Yabasi\Database\Migrations\MigrationInterface;

class CreateUsersTable implements MigrationInterface
{
    public function up(Connection $connection): void
    {
        $connection->schema()->create('users', function ($table) {
            $table->id();
            $table->string('name');
            $table->string('email')->unique();
            $table->timestamps();
        });
    }

    public function down(Connection $connection): void
    {
        $connection->schema()->dropIfExists('users');
    }
}
```

Run migrations:

```
php yabasi migrate
```

WebSockets
----------

[](#websockets)

Set up a WebSocket server:

```
namespace App\WebSockets;

use Ratchet\ConnectionInterface;
use Yabasi\WebSocket\BaseWebSocketServer;

class ChatServer extends BaseWebSocketServer
{
    public function onMessage(ConnectionInterface $from, $msg)
    {
        foreach ($this->clients as $client) {
            $client->send($msg);
        }
    }
}
```

Start the WebSocket server:

```
php yabasi websocket:serve
```

Queue System
------------

[](#queue-system)

Define a job:

```
namespace App\Jobs;

use Yabasi\Queue\Job;

class SendEmailJob extends Job
{
    protected $email;

    public function __construct($email)
    {
        $this->email = $email;
    }

    public function handle()
    {
        // Send email logic here
    }
}
```

Dispatch a job:

```
$queueManager->push(new SendEmailJob('user@example.com'));
```

Process jobs:

```
php yabasi queue:work
```

Testing
-------

[](#testing)

Run the test suite:

```
vendor/bin/phpunit
```

Documentation
-------------

[](#documentation)

For more detailed information, please refer to our official documentation.

Contributing
------------

[](#contributing)

We welcome contributions to the Yabasi Framework. Please see our [CONTRIBUTING.md](CONTRIBUTING.md) file for details on how to contribute.

License
-------

[](#license)

The Yabasi Framework is open-sourced software licensed under the MIT license.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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

573d ago

### Community

Maintainers

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

---

Top Contributors

[![yabasi](https://avatars.githubusercontent.com/u/2900493?v=4)](https://github.com/yabasi "yabasi (27 commits)")

### Embed Badge

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

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

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

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

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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