PHPackages                             blcklab/panulat-core - 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. blcklab/panulat-core

ActiveLibrary[Framework](/categories/framework)

blcklab/panulat-core
====================

A modular, lightweight PHP framework for building clean REST APIs and API-first applications.

v0.1.1(1mo ago)0343MITPHP ^8.3

Since Jul 6Compare

[ Source](https://github.com/blcklab/panulat-core)[ Packagist](https://packagist.org/packages/blcklab/panulat-core)[ RSS](/packages/blcklab-panulat-core/feed)WikiDiscussions Synced 1w ago

READMEChangelogDependencies (3)Versions (3)Used By (3)

 [![Packagist version](https://camo.githubusercontent.com/3b30497cee8b6ea24487326267dd9b29b9d2f6614143615f0c8872410d388492/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626c636b6c61622f70616e756c61742d636f72653f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/3b30497cee8b6ea24487326267dd9b29b9d2f6614143615f0c8872410d388492/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626c636b6c61622f70616e756c61742d636f72653f7374796c653d666c61742d737175617265) [![downloads](https://camo.githubusercontent.com/0024da1872b5f92acd748d2945c431d02c3b64d89d2bb2004cfb596b54e4c51e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f626c636b6c61622f70616e756c61742d636f72653f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/0024da1872b5f92acd748d2945c431d02c3b64d89d2bb2004cfb596b54e4c51e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f626c636b6c61622f70616e756c61742d636f72653f7374796c653d666c61742d737175617265) [![CI](https://github.com/blcklab/panulat-core/actions/workflows/ci.yml/badge.svg)](https://github.com/blcklab/panulat-core/actions/workflows/ci.yml/badge.svg) [![license](https://camo.githubusercontent.com/d94bd2f798acfef0e19d067bd74520be6f10a8f56fb2c3363b52df31dd5501e0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f626c636b6c61622f70616e756c61742d636f72653f763d32)](https://camo.githubusercontent.com/d94bd2f798acfef0e19d067bd74520be6f10a8f56fb2c3363b52df31dd5501e0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f626c636b6c61622f70616e756c61742d636f72653f763d32)

Panulat Core
============

[](#panulat-core)

Panulat Core is the modular foundation of Panulat, a lightweight PHP framework for building clean REST APIs and API-first applications.

Features
--------

[](#features)

- HTTP request and response handling
- Routing and route groups
- Dependency injection container
- Middleware pipeline
- Application kernel and service providers
- Configuration and environment loading
- Error handling with safe JSON responses
- Validation
- Database connection and query builder
- Migrations and seeders
- Lightweight model support
- Cache contracts and local cache drivers
- Rate limiting
- CORS support
- API-key middleware
- Resources and pagination
- Console command foundation
- File upload support
- Health and readiness endpoints

Optional features such as JWT authentication, developer scaffolding, Redis, queues, and OpenAPI support are provided through separate packages instead of being bundled into the core.

Install
-------

[](#install)

```
composer require blcklab/panulat-core
```

For new applications, use the Panulat starter project:

```
composer create-project blcklab/panulat my-api
```

Requirements
------------

[](#requirements)

- PHP 8.3 or higher
- `ext-json`
- `ext-pdo`
- A PDO database driver such as `pdo_mysql` or `pdo_sqlite`

Basic Usage
-----------

[](#basic-usage)

```
use Panulat\Foundation\Application;
use Panulat\Foundation\FrameworkServiceProvider;
use Panulat\Http\Response;

$app = new Application(__DIR__);

$app->register(new FrameworkServiceProvider(__DIR__));

$app->router()->get('/health', function () {
    return Response::json([
        'status' => 'ok',
    ]);
});

$app->run();
```

For full applications, the starter project includes the recommended structure, bootstrap files, configuration, routes, and development tooling.

Routing
-------

[](#routing)

```
$router->get('/users', [UserController::class, 'index']);
$router->post('/users', [UserController::class, 'store']);
$router->get('/users/{id}', [UserController::class, 'show']);
$router->put('/users/{id}', [UserController::class, 'update']);
$router->delete('/users/{id}', [UserController::class, 'destroy']);
```

Route groups can share prefixes and middleware:

```
$router->group('/v1', function ($router) {
    $router->get('/users', [UserController::class, 'index']);
    $router->post('/users', [UserController::class, 'store']);
}, ['api']);
```

Middleware
----------

[](#middleware)

Middleware can be registered as aliases or grouped together:

```
$app->middlewareAlias('api-key', ApiKeyMiddleware::class);

$app->middlewareGroup('api', [
    'api-key',
    'throttle:api',
]);

$router->get('/users', [UserController::class, 'index'], [
    'api',
]);
```

Named throttles are also supported:

```
$app->throttle('login', maxAttempts: 5, windowSeconds: 60);

$router->post('/auth/login', [AuthController::class, 'login'], [
    'throttle:login',
]);
```

Query Builder
-------------

[](#query-builder)

```
$users = $db->table('users')
    ->select(['id', 'name', 'email'])
    ->whereNull('deleted_at')
    ->orderBy('id', 'desc')
    ->paginate(page: 1, perPage: 20);
```

```
$userId = $db->table('users')->insertGetId([
    'name' => 'Avelino',
    'email' => 'avelino@example.test',
]);
```

The query builder supports common API data operations, including filtering, pagination, inserts, updates, deletes, joins, aggregates, transactions, and raw queries with bindings.

Responses
---------

[](#responses)

```
return Response::json([
    'message' => 'Created',
], 201);

return Response::text('ok');

return Response::noContent();
```

File Uploads
------------

[](#file-uploads)

```
$file = $request->file('avatar');

if ($request->hasFile('avatar')) {
    $file->moveTo(__DIR__ . '/storage/uploads/avatar.png');
}
```

Uploaded files are represented by `Panulat\Http\UploadedFile`.

Production
----------

[](#production)

Use safe production settings:

```
APP_ENV=production
APP_DEBUG=false
```

For optimized production installs:

```
composer install --no-dev --optimize-autoloader
```

In production, errors are returned as safe JSON responses without stack traces.

Related Packages
----------------

[](#related-packages)

- `blcklab/panulat-core` — framework core
- `blcklab/panulat` — starter API project
- `blcklab/panulat-jwt` — optional JWT authentication package
- `blcklab/panulat-cli` — optional developer CLI and scaffolding commands

License
-------

[](#license)

MIT

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

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

2

Last Release

48d ago

### Community

Maintainers

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

---

Tags

phpjsonapiframeworkrestpanulat

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/blcklab-panulat-core/health.svg)

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

###  Alternatives

[php-curl-class/php-curl-class

PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs.

3.3k10.1M401](/packages/php-curl-class-php-curl-class)[atk4/api

Agile API - Extensible API server in PHP for Agile Data

143.7k1](/packages/atk4-api)[patricksavalle/slim-rest-api

Production-grade REST-API App-class for PHP SLIM, in production on https://zaplog.pro (https://api.zaplog.pro/v1)

101.4k](/packages/patricksavalle-slim-rest-api)

PHPackages © 2026

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