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

ActiveLibrary[Framework](/categories/framework)

nextphp/data
============

The NextPHP Data package is a powerful tool for PHP developers, providing ORM capabilities and direct SQL query execution. This package is part of the NextPHP Framework, a modern and lightweight PHP framework designed for performance and scalability.

1.3.0(1y ago)0301MITPHPPHP ^8.1

Since Jul 3Pushed 1y ago1 watchersCompare

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

READMEChangelog (2)DependenciesVersions (3)Used By (1)

NextPHP Data Package
====================

[](#nextphp-data-package)

The [NextPHP Data](https://packagist.org/packages/nextphp/data) package is a powerful tool for PHP developers, providing ORM capabilities and direct SQL query execution. It simplifies database interactions by allowing developers to work with objects instead of raw SQL queries. With support for attributes to define entities and relationships, NextPHP Data ensures a clean and efficient codebase.

This package is part of the [NextPHP Framework](https://https://github.com/nextphp-projects/nextphp), a modern and lightweight PHP framework designed for performance and scalability. [NextPHP](https://nextphp.io) aims to provide a comprehensive suite of tools and libraries to streamline the development process.

Features
--------

[](#features)

- ORM with attribute-based entity definitions
- Direct SQL query capabilities
- Transactional support
- Relationship handling (OneToMany, ManyToOne, etc.)
- Easy integration with existing projects

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

[](#installation)

### Installing via Composer

[](#installing-via-composer)

To install the NextPHP Data package, you need to add it to your project using Composer.

```
composer require nextphp/data
```

Example Project using NextPHP Data
==================================

[](#example-project-using-nextphp-data)

This is an example project demonstrating the usage of the NextPHP Data package, which includes ORM and direct SQL query capabilities.

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

[](#basic-usage)

### Defining Entities

[](#defining-entities)

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

Usage
-----

[](#usage)

### Using Entity

[](#using-entity)

```
