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

ActiveProject[Framework](/categories/framework)

maharlika/framework
===================

The Skeleton for the Maharlika Php framework

v1.0.13(3mo ago)013MITPHPPHP ^8.2

Since Jan 26Pushed 3mo agoCompare

[ Source](https://github.com/joshdevkit/maharlika-framework)[ Packagist](https://packagist.org/packages/maharlika/framework)[ GitHub Sponsors](https://github.com/joshdevkit)[ RSS](/packages/maharlika-framework/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (16)Used By (0)

⚡ Maharlika Framework
=====================

[](#-maharlika-framework)

**Modern PHP Framework for Elegant Web Development**

[![PHP Version](https://camo.githubusercontent.com/13d44c226edc4671d7d176b844577a2ff00f3f21a96ada4563d539bf4bd2fed3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322b2d3737374242343f7374796c653d666c61742d737175617265266c6f676f3d706870)](https://php.net)[![License](https://camo.githubusercontent.com/152aa2a37725b9fd554b28ff24d270f6071c67927a63e6d635a55c8e188e20c7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e3f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/d0f7c560b3a5938cd2e544e032f0684a3299209758eb917a6566b03dd8ac0f52/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4275696c642d50617373696e672d737563636573733f7374796c653d666c61742d737175617265)](https://github.com)[![Code Quality](https://camo.githubusercontent.com/5910fbdb7f5c55c3f933d8eeca45406562be8bde40022d7052f9394cddd85d26/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f64652532305175616c6974792d412b2d626c75653f7374796c653d666c61742d737175617265)](https://github.com)

[Features](#-features) • [Installation](#-installation) • [Documentation](#-documentation) • [Examples](#-quick-examples) • [Contributing](#-contributing)

---

🎯 Why Maharlika?
----------------

[](#-why-maharlika)

Maharlika is a modern PHP framework built for developers who value **elegant syntax**, **performance**, and **developer experience**. Born from the need for a lightweight yet powerful framework that doesn't compromise on features.

```
// This is all you need for a complete API endpoint
class UserController
{
    #[HttpGet('/api/users/{id}')]
    public function show(int $id): JsonResponse
    {
        return response()->json(
            User::find($id)
        );
    }
}
```

✨ Features
----------

[](#-features)

### 🚀 Modern Architecture

[](#-modern-architecture)

- **Attribute-Based Routing** - Clean, declarative route definitions using PHP 8 attributes
- **Blade Templating** - Powerful, intuitive templating with component support
- **Query Builder** - Eloquent-style database interactions with full type safety
- **Dependency Injection** - Automatic dependency resolution and service container
- **Middleware System** - Flexible request/response filtering

### 🎨 Developer Experience

[](#-developer-experience)

- **Hot Reloading** - Instant feedback during development
- **Beautiful Error Pages** - Whoops integration for readable stack traces
- **CLI Tools** - Artisan-like commands for migrations, scaffolding, and more
- **Component System** - Reusable Blade components with full data binding

### 🛡️ Security First

[](#️-security-first)

- CSRF Protection out of the box
- SQL Injection prevention
- XSS filtering
- Secure session handling
- Password hashing with modern algorithms

### ⚡ Performance

[](#-performance)

- Optimized routing with zero overhead
- Intelligent query caching
- Minimal memory footprint
- Production-ready from day one
- Automatic Routing, discover route prefix and route naming convention

📦 Installation
--------------

[](#-installation)

### Requirements

[](#requirements)

- PHP 8.2 or higher
- Composer
- MySQL/PostgreSQL/SQLite

### Quick Start

[](#quick-start)

```
# Create a new project
composer create-project maharlika/maharlika my-app

# Navigate to project
cd my-app

# Run development server
php maharlika serve
```

Your application is now running at `http://localhost:8000` 🎉

🏗️ Project Structure
--------------------

[](#️-project-structure)

```
my-app/
├── app/
│   ├── Controllers/     # HTTP controllers
│   ├── Models/          # Database models
│   ├── Middleware/      # Request middleware
│   └── View/
│       └── Components/  # Blade components
├── config/              # Configuration files
├── database/
│   └── migrations/      # Database migrations
├── public/              # Public assets
├── resources/
│   └── views/           # Blade templates
└── storage/             # Logs, cache, sessions

```

🚦 Quick Examples
----------------

[](#-quick-examples)

### Creating Routes

[](#creating-routes)

```
use Maharlika\Routing\Attributes\HttpGet;
use Maharlika\Routing\Attributes\HttpPost;

class PostController
{
    #[HttpGet('/posts')]
    public function index()
    {
        return view('posts.index', [
            'posts' => Post::all()
        ]);
    }

    #[HttpPost('/posts')]
    public function store(Request $request)
    {
        $post = Post::create($request->validated());

        return redirect("/posts/{$post->id}")
            ->with('success', 'Post created!');
    }

    #[HttpGet('/api/posts')]
    public function apiIndex()
    {
        return response()->json([
            'data' => Post::with('author')->get()
        ]);
    }
}
```

### Building Blade Components

[](#building-blade-components)

```
// app/View/Components/Alert.php
namespace App\View\Components;

use Maharlika\View\Component;

class Alert extends Component
{
    public function __construct(
        public string $type = 'info',
        public string $message = ''
    ) {}

    public function render()
    {
        return view('components.alert');
    }

    public function getColorClass(): string
    {
        return match($this->type) {
            'success' => 'bg-green-100 text-green-800',
            'error' => 'bg-red-100 text-red-800',
            'warning' => 'bg-yellow-100 text-yellow-800',
            default => 'bg-blue-100 text-blue-800',
        };
    }
}
```

```

    {{ $message }}

```

```

```

### Working with Database

[](#working-with-database)

```
// Create a migration
php maharlika make:migration create_posts_table

// Run migrations
php maharlika migrate

// Query builder usage
$posts = DB::table('posts')
    ->where('published', true)
    ->orderBy('created_at', 'desc')
    ->limit(10)
    ->get();

// Eloquent-style models
class Post extends Model
{
    protected $fillable = ['title', 'content', 'user_id'];

    public function author()
    {
        return $this->belongsTo(User::class, 'user_id');
    }
}

// Use relationships
$posts = Post::with('author')
    ->where('published', true)
    ->get();
```

### Middleware

[](#middleware)

```
namespace App\Middleware;

class Authenticate
{
    public function handle(Request $request, Closure $next)
    {
        if (!session('user_id')) {
            return redirect('/login');
        }

        return $next($request);
    }
}

// Apply to routes
#[HttpGet('/dashboard')]
#[Middleware(Authenticate::class)]
public function dashboard()
{
    return view('dashboard');
}
```

🎨 Blade Templating
------------------

[](#-blade-templating)

Maharlika uses Blade for templating with full component support:

```
{{-- resources/views/layout.blade.php --}}

    @yield('title')

        @yield('content')

```

```
{{-- resources/views/posts/show.blade.php --}}
@extends('layout')

@section('title', $post->title)

@section('content')

        {{ $post->title }}

            {!! $post->content !!}

        @if($post->comments->isNotEmpty())

        @endif

@endsection
```

🛠️ CLI Commands
---------------

[](#️-cli-commands)

```
# Generate files
php maharlika make:controller UserController
php maharlika make:model Post
php maharlika make:migration create_users_table
php maharlika make:component Alert

# Database operations
php maharlika migrate              # Run migrations
php maharlika migrate:rollback     # Rollback last batch
php maharlika migrate:reset        # Rollback all migrations
php maharlika migrate:refresh      # Reset and re-run all migrations

# Development
php maharlika serve               # Start development server
php maharlika routes              # List all routes

# Cache management
php maharlika cache:clear         # Clear application cache

and more cli available, type php maharlika command
```

📚 Documentation
---------------

[](#-documentation)

Full documentation is not yet available

🎯 Roadmap
---------

[](#-roadmap)

- Attribute-based routing
- Blade templating engine
- Component system
- Query builder
- Migration system
- Authentication scaffolding
- Email system
- Queue system
- WebSocket support
- GraphQL integration
- Testing utilities

🤝 Contributing
--------------

[](#-contributing)

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

```
# Fork the repository
# Clone your fork
git clone https://github.com/joshdevkit/maharlika-framework

# Create a feature branch
git checkout -b feature/amazing-feature

# Make your changes and commit
git commit -m 'Add amazing feature'

# Push to your fork
git push origin feature/amazing-feature

# Open a Pull Request
```

### Development Setup

[](#development-setup)

```
# Install dependencies
composer install

# Run tests
./vendor/bin/phpunit

# Code style check
./vendor/bin/phpcs

# Fix code style
./vendor/bin/phpcbf
```

📄 License
---------

[](#-license)

Maharlika Framework is open-sourced software licensed under the [MIT license](LICENSE).

🙏 Acknowledgments
-----------------

[](#-acknowledgments)

- Inspired by Laravel's elegant syntax
- Built with modern PHP best practices
- Developed and maintained by: Joshua Mendoza Pacho

---

**Built with ❤️ by developer, for developers**

[⭐ Star us on GitHub](https://github.com/joshdevkit/maharlika-framework)

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance79

Regular maintenance activity

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

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

Every ~0 days

Total

14

Last Release

108d ago

### Community

Maintainers

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

---

Top Contributors

[![joshdevkit](https://avatars.githubusercontent.com/u/102531192?v=4)](https://github.com/joshdevkit "joshdevkit (20 commits)")

---

Tags

frameworkmvcmaharlika

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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