Dev.to WebDev 🛠 Dev 👁 0 📖 6 min read

SqueHub v2.0.0 Is Here — A New Generation of the PHP Framework for Modern Web Builders

SqueHub v2.0.0 Is Here 🚀 After a major development effort, SqueHub v2.0.0 is officially available. This is the first stable release of the SqueHub v2 generation and represents much more than an update to SqueHub v1.

SqueHub v2.0.0 Is Here 🚀

After a major development effort, SqueHub v2.0.0 is officially available.

This is the first stable release of the SqueHub v2 generation and represents much more than an update to SqueHub v1.

SqueHub v2 was rebuilt around a simple goal:

Make PHP development simple to start, powerful enough to grow, and pleasant to work with.

SqueHub is an open-source PHP framework for building modern web applications, APIs, services, and modular applications without unnecessarily complicating the development experience.

Version 2.0.0 requires PHP 8.2+ and introduces a redesigned foundation across routing, data, security, background processing, developer tooling, packages, and more.

Why SqueHub v2?

When building v2, I didn't want to simply add more features to the existing framework.

The goal was to create a stronger foundation.

SqueHub v2 separates your application from the framework itself:

App/          Framework internals
Config/       Application configuration
Database/     Migrations, Seeders, and Factories
Project/      Your application
public/       Public web root and assets
Storage/      Private runtime data
Documentation/

Most application development happens inside:

Project/

That includes your:

  • Controllers
  • Models
  • Routes
  • Views
  • Middleware
  • Packages
  • Kits
  • Application-specific logic

The framework internals remain under App/.

This separation is designed to keep SqueHub applications organized and make the framework easier to evolve.

A New Routing API

Routing was one of the areas redesigned for SqueHub v2.

A simple route looks like this:

<?php

use App\Plugins\Route;

Route::path('/hello')
    ->get(static fn (): string => 'Hello, SqueHub!');

Controller routes can remain expressive while keeping the path at the center of the declaration:

Route::path('/users/{id}')
    ->get([UserController::class, 'show'])
    ->named('users.show')
    ->through('auth');

Groups can also compose prefixes and middleware:

Route::group()
    ->prefix('/admin')
    ->through('auth')
    ->routes(function (): void {
        // Admin routes
    });

The goal isn't to create clever syntax.

It's to make routes easy to read when you return to a project months later.

Middleware

SqueHub v2 includes a middleware pipeline for handling concerns such as:

  • Authentication
  • Authorization
  • Rate limiting
  • CSRF protection
  • Request filtering
  • Package middleware
  • Application-specific request processing

Middleware can be attached directly to routes or composed through route groups.

Database, Models, and Migrations

The data layer in v2 includes:

  • Database connection management
  • Query builder
  • Schema builder
  • Migrations
  • Models
  • Collections
  • Pagination
  • Seeders
  • Factories
  • Model relationships

Relationships include support for:

hasOne
hasMany
belongsTo
belongsToMany

Models also support eager loading and relationship caching.

Authentication and Authorization

Security is another major part of SqueHub v2.

The framework includes foundations for:

  • Authentication
  • Multiple guards
  • Authorization
  • Policies
  • Abilities
  • Password hashing
  • Password changes
  • Password reset tokens
  • Email verification
  • Personal access tokens
  • Session security
  • CSRF protection
  • Rate limiting

SqueHub v2 also includes credential/session protections designed for applications where account security matters.

Views

SqueHub includes its own view system.

Templates use the .squehub.php extension and support features including:

  • Escaped output
  • Raw output
  • Layouts
  • Components
  • Includes
  • Forms
  • CSRF helpers
  • Validation errors
  • Old input
  • Compiled views

PHP applications can use SqueHub Views without requiring Node.js.

For developers who want a frontend toolchain, optional profiles can also support technologies such as Vite, React, and Vue.

Background Work

Modern applications frequently need work that shouldn't happen directly during an HTTP request.

SqueHub v2 includes:

Queue

Applications can dispatch work to queues and process it through workers.

Scheduler

Recurring and scheduled application tasks can be defined and executed through the SqueHub scheduler.

Mail

Mail can be sent synchronously or integrated with the queue system.

Notifications

Applications can build notification workflows and defer them to background workers when required.

Redis, Cache, and Sessions

SqueHub v2 includes Redis integration that can be used across different framework services.

This includes support for areas such as:

  • Cache
  • Sessions
  • Rate limiting
  • Queues

Applications that don't require Redis aren't forced to use it.

Storage

The storage system supports named drives and provides APIs for operations such as:

  • Reading
  • Writing
  • Copying
  • Moving
  • Directories
  • Streams
  • Metadata
  • File listing

The local storage implementation also includes path validation and protections around filesystem boundaries.

Events

Applications can use SqueHub's event system to keep components decoupled.

Listeners can be registered and events emitted without forcing unrelated components to know about each other.

This becomes particularly useful as applications and packages grow.

HTTP Client

SqueHub v2 includes an HTTP client for communicating with external services and APIs.

It supports common operations including:

GET
POST
PUT
PATCH
DELETE
HEAD
OPTIONS

Along with features such as:

  • JSON requests
  • Form requests
  • Multipart requests
  • Headers
  • Authentication
  • Timeouts
  • Redirects
  • Streaming downloads
  • Retries and backoff

Cryptography

The framework also provides a cryptography layer for protecting application data.

Depending on the available environment, SqueHub can use modern authenticated encryption implementations while keeping encryption behind a consistent application-facing API.

Packages and Kits

Extensibility is important to the direction of SqueHub.

Applications can be organized using Packages and Kits, while framework functionality intended for developers is exposed through the stable:

App\Plugins

namespace.

For example:

use App\Plugins\Route;
use App\Plugins\Schema;
use App\Plugins\DB;

The intention is to give developers a stable surface without requiring application code to depend heavily on internal framework implementation details.

Developer Tools

SqueHub ships with its own CLI.

After installing a project, you can inspect available commands with:

php squehub help

One command I'm particularly happy with is:

php squehub doctor

Doctor inspects the application environment and helps identify configuration or infrastructure problems.

Other tooling covers areas such as routes, migrations, queues, scheduling, generators, setup, testing, and diagnostics.

Installing SqueHub v2

SqueHub v2 can be installed through Composer:

composer create-project squehub/squehub my-app "^2.0"

Then:

cd my-app

Create your environment configuration and generate an application key:

php squehub key:generate

Check the environment:

php squehub doctor

And start the application:

php squehub start

You can then create your first route inside:

Project/Routes/Web.php
<?php

use App\Plugins\Route;

Route::path('/')
    ->get(static fn (): string => 'Built with SqueHub 🚀');

Tested Across Windows and Linux

Portability was an important release requirement for v2.0.0.

The stable release was qualified through CI on both:

  • Ubuntu/Linux
  • Windows

The release process also included extensive automated testing across the framework's components.

What About SqueHub v1?

SqueHub v2 is a major-generation release.

It should not be treated as a drop-in update for an existing v1 application.

There are intentional architecture and API changes between the generations.

If you're maintaining a SqueHub v1 project, use the official v1 → v2 upgrade guide before migrating.

What I'm Trying to Build With SqueHub

There are already excellent PHP frameworks.

SqueHub isn't being built because PHP needs another framework that simply copies what already exists.

The goal is to explore a different balance:

Simple APIs. Strong internals. Modern capabilities. Clear application structure.

I want a developer to be able to create a small PHP application without fighting the framework, but also have the tools available when that project grows into something much larger.

SqueHub v2.0.0 is the foundation for that direction.

And now that the stable v2 generation is available, the next stage isn't only about adding features.

It's about building the ecosystem and community around it.

SqueHub Is Open Source ❤️

SqueHub is released under the MIT License.

If you're a PHP developer, I'd genuinely like you to try it.

Build something small.

Explore the routing API.

Try the ORM.

Break something.

Open an issue.

Suggest an API improvement.

Build a package.

Or contribute directly to the framework.

SqueHub will become better through developers actually using it and challenging its design.

Resources

Website: squehub.com

Documentation: squehub.com/docs/v2.x

GitHub: github.com/squehub/squehub

Package: squehub/squehub

composer create-project squehub/squehub my-app "^2.0"

If you try SqueHub, I'd love to hear what you think.

What would you expect from a modern PHP framework in 2026?

php #opensource #webdev #framework

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.