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

ActiveProject[Framework](/categories/framework)

nextphp/nextphp
===============

NextPHP is a modern and lightweight PHP framework designed for performance and scalability. It offers powerful routing capabilities, comprehensive HTTP handling, and efficient database operations. NextPHP is ideal for developers looking to build high-performance web applications with ease.

1.0.0(1y ago)4132MITPHPPHP ^8.1

Since Jul 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/nextphp-projects/nextphp)[ Packagist](https://packagist.org/packages/nextphp/nextphp)[ Docs](https://nextphp.io)[ RSS](/packages/nextphp-nextphp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

NextPHP | Next Generation PHP Framework
=======================================

[](#nextphp--next-generation-php-framework)

[![Patreon](https://camo.githubusercontent.com/1c850c3f508233ab29a313ce2262c06ca031f5902db2135071b007e355b2ded5/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6d6573736167653d50617472656f6e266c6f676f3d70617472656f6e266c6162656c3d26636f6c6f723d463936383534266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d267374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/1c850c3f508233ab29a313ce2262c06ca031f5902db2135071b007e355b2ded5/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6d6573736167653d50617472656f6e266c6f676f3d70617472656f6e266c6162656c3d26636f6c6f723d463936383534266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d267374796c653d666f722d7468652d6261646765)[![Twitter](https://camo.githubusercontent.com/450f26aabd462fc6f40f898b3305b34c3b5da3b9bcc17c6c1f1f683b7d357617/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6d6573736167653d54776974746572266c6f676f3d74776974746572266c6162656c3d26636f6c6f723d314441314632266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d267374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/450f26aabd462fc6f40f898b3305b34c3b5da3b9bcc17c6c1f1f683b7d357617/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6d6573736167653d54776974746572266c6f676f3d74776974746572266c6162656c3d26636f6c6f723d314441314632266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d267374796c653d666f722d7468652d6261646765)[![Codepen](https://camo.githubusercontent.com/f6cc7994decbb354130e82ba859243af6d7afa5f50b85b6c5c637a6fb26ee358/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6d6573736167653d436f646570656e266c6f676f3d636f646570656e266c6162656c3d26636f6c6f723d303030303030266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d267374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/f6cc7994decbb354130e82ba859243af6d7afa5f50b85b6c5c637a6fb26ee358/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6d6573736167653d436f646570656e266c6f676f3d636f646570656e266c6162656c3d26636f6c6f723d303030303030266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d267374796c653d666f722d7468652d6261646765)[![Stackoverflow](https://camo.githubusercontent.com/067b2a8f934568cb6432c80d72f594bd919af79bbdc638c02bd8664431bebaca/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6d6573736167653d537461636b6f766572666c6f77266c6f676f3d737461636b6f766572666c6f77266c6162656c3d26636f6c6f723d464537413136266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d267374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/067b2a8f934568cb6432c80d72f594bd919af79bbdc638c02bd8664431bebaca/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6d6573736167653d537461636b6f766572666c6f77266c6f676f3d737461636b6f766572666c6f77266c6162656c3d26636f6c6f723d464537413136266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d267374796c653d666f722d7468652d6261646765)[![Slack](https://camo.githubusercontent.com/bbf326b1825d53652a59a409eb8de8c67a6f06868c3b5490a765aa2e015c083e/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6d6573736167653d536c61636b266c6f676f3d736c61636b266c6162656c3d26636f6c6f723d344131353442266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d267374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/bbf326b1825d53652a59a409eb8de8c67a6f06868c3b5490a765aa2e015c083e/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6d6573736167653d536c61636b266c6f676f3d736c61636b266c6162656c3d26636f6c6f723d344131353442266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d267374796c653d666f722d7468652d6261646765)[![LinkedIn](https://camo.githubusercontent.com/869970a534f095bf21894003fdcaecd1c66bbac93d87acecc050e55943308b75/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6d6573736167653d4c696e6b6564496e266c6f676f3d6c696e6b6564696e266c6162656c3d26636f6c6f723d303037374235266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d267374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/869970a534f095bf21894003fdcaecd1c66bbac93d87acecc050e55943308b75/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6d6573736167653d4c696e6b6564496e266c6f676f3d6c696e6b6564696e266c6162656c3d26636f6c6f723d303037374235266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d267374796c653d666f722d7468652d6261646765)

About NextPHP
-------------

[](#about-nextphp)

NextPHP is a next-generation, lightweight PHP framework designed for rapid web application development. Optimized for modern cloud environments, it excels in speed, performance, and efficiency, making it the ideal choice for developers aiming to build scalable and secure applications swiftly.

### Key Features

[](#key-features)

- **Agile and Lean:** Ideal for rapid MVP development with minimal setup.
- **Cloud-Ready:** Runs seamlessly on any PHP hosting, ensuring high performance.
- **Integrated Core Features:** Built-in error handling, logging, email, JWT authentication, and more.
- **Minimalist Architecture:** Lightweight and efficient, reducing resource usage.
- **RESTful API Support:** Robust and easy-to-use API creation.

### Mission

[](#mission)

Our mission is to provide a lightweight, easy-to-use PHP framework that helps developers and startups quickly bring their ideas to life. We believe in simplicity, efficiency, and delivering value without unnecessary complexity.

### Vision

[](#vision)

We envision a world where developers can focus on building innovative solutions without being bogged down by complex setups and configurations. NextPHP aims to be the go-to framework for rapid development and agile methodologies.

### Why NextPHP?

[](#why-nextphp)

In today’s digital transformation era, the speed of development, application performance, and resource efficiency are crucial. NextPHP addresses these needs by offering:

- **Simplicity:** Quick and easy setup, no extensive configurations.
- **Performance:** High-speed execution and low resource consumption.
- **Flexibility:** Adaptable for both simple web apps and complex APIs.
- **Community and Support:** Active community with professional support options.

### Development History

[](#development-history)

NextPHP evolved from LeanPHP, NovaPHP, and NGPHP, each bringing unique strengths such as minimalism, optional composer support, and a fully modular architecture. NextPHP combines the strengths of its predecessors with comprehensive support for modern web development needs, optimized for cloud-based projects.

### Packages

[](#packages)

NextPHP offers a range of packages to enhance functionality and streamline development:

- **nextphp/rest:** - [Nextphp\\Data](https://github.com/nextphp-projects/rest): RESTful API operations.
- **nextphp/data:** - [Nextphp\\Rest](https://github.com/nextphp-projects/data): CRUD and All operations and database adapters.
- **nextphp/jwt:** - [Nextphp\\JWT](https://github.com/nextphp-projects/data): JWT package
- **nextphp/logging:** Logging operations.
- **nextphp/reporting:** Reporting functionalities.
- **nextphp/mail:** Email operations.
- **nextphp/auth:** Authorization and authentication.
- **nextphp/jwt:** JWT-based authentication.
- **nextphp/testing:** Testing operations.
- **nextphp/qa:** Quality assurance and testing.
- **nextphp/cache:** Caching operations.
- **nextphp/queue:** Background jobs and task queues.
- **nextphp/config:** Application configurations.
- **nextphp/files:** File management and uploads.
- **nextphp/uploads:** File upload operations.

Comparison with Other Frameworks
--------------------------------

[](#comparison-with-other-frameworks)

Unlike some other frameworks that can be cumbersome and resource-intensive, NextPHP is designed to be lean and efficient. This means faster development times, lower resource consumption, and reduced hosting costs.

FeatureNextPHPOther FrameworksEasy Setup &amp; Rapid Development★★★★★★★★Integrated Core Features★★★★★★★★★Ease of Learning★★★★★★★★Performance &amp; Speed★★★★★★★★Community Support★★★★★★★★★Ideal for Startups★★★★★★★★Download &amp; Use Capability★★★★★★★★Source Code Size★★★★★ (Kilobytes)★★ (Megabytes)RESTful API Support★★★★★★★★★### Unique Advantages of NextPHP

[](#unique-advantages-of-nextphp)

- **No Bloat:** Only include what you need. This makes NextPHP exceptionally fast and responsive.
- **Resource Efficiency:** Optimized for low resource consumption, making it perfect for cloud environments and cost-effective deployments.
- **Rapid Prototyping:** Quickly go from concept to prototype with minimal overhead.
- **Scalability:** Designed with scalability in mind, making it easy to grow your application as your business expands.
- **Security:** Built-in security features ensure your applications are protected from common vulnerabilities.

NextPHP Framework Usage Documentation
=====================================

[](#nextphp-framework-usage-documentation)

Overview
--------

[](#overview)

The NextPHP Framework is a modern and lightweight PHP framework. Designed for high performance and scalability, it offers a comprehensive set of tools and libraries to accelerate the development process. The framework includes various packages such as NextPHP Rest and NextPHP Data.

Features
--------

[](#features)

- Supports all RESTful methods (GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD, TRACE, CONNECT, PRI)
- Response formats: JSON, XML, HTML, TEXT, CSV
- Attribute-based route definitions
- Middleware and JWT support
- Attribute-based entity definitions with ORM
- Direct SQL query capabilities
- Relationship management (OneToMany, ManyToOne, etc.)
- Easy integration with existing projects

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

[](#installation)

### Installation with Composer

[](#installation-with-composer)

To add the NextPHP package to your project, run the following command using Composer:

```
composer require nextphp/nextphp
```

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

[](#basic-usage)

NextPHP comes ***with an example project demonstrating a full multi-layered architecture CRUD operation*** with ***User*** and ***Post*** examples.

### Defining Entities

[](#defining-entities)

Entities represent the tables in your database. Use attributes to define the properties and their types.

```
