Download the PHP package wpmvc/database without Composer

On this page you can find all versions of the php package wpmvc/database. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package database

Total Downloads Latest Stable Version License

WpMVC Database

WpMVC Database is a powerful SQL query builder tailored for WordPress plugins, offering a fluent and intuitive interface inspired by Laravel's Eloquent Query Builder. It simplifies database operations, relationships, and schema management for WordPress developers.


Table of Contents


Installation

Install WpMVC Database using Composer:


Schema Builder

The Schema Builder provides a fluent interface for creating and modifying database tables.

Creating Tables

Create a table with the Schema::create method:

Altering Tables

Modify an existing table with Schema::alter:

Dropping or Renaming Tables

Drop or rename tables as needed:

Returning SQL Queries

Generate SQL without executing it by passing true as the third argument:

Foreign Key Safety

Foreign keys are automatically checked to avoid duplicates. The naming convention is:

Example Schema

A complete example for a products table:

Supported Blueprint Methods

Column Types

Column Modifiers

Indexes & Constraints


Eloquent Models

Creating Models

Define an Eloquent model by extending the Model class:

Inserting Data

Insert a single record:

Insert multiple records:

Insert and retrieve the ID:

Updating Data

Update a record based on a condition:

Deleting Data

Delete a record based on a condition:

Reading Data

Aggregates

Retrieve aggregate values like count, max, min, avg, or sum:

Retrieving Models

Fetch all records:

Fetch a single record:

Select Statements

Select specific columns:

Use distinct for unique results:

Joins

Perform an inner join:

Perform left or right joins:

Advanced join with a closure:

Where Clauses

Basic where clause:

Or where clause:

Where exists clause:

Where between:

Where in:

Ordering, Grouping, Limit & Offset

Order results:

Group results:

Limit and offset:


Relationships

WpMVC Database supports common Eloquent relationships for managing related data.

One-to-One

Define a one-to-one relationship (e.g., a User has one Phone):

Retrieve users with their phones:

One-to-Many

Define a one-to-many relationship (e.g., a Post has many PostMeta):

One-to-Many (Inverse) / Belongs To

Define the inverse relationship (e.g., a PostMeta belongs to a Post):

Constraining Query Loads

Add conditions to relationship queries:


License

WpMVC Database is open-source software licensed under the MIT License.


All versions of database with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wpmvc/database contains the following files

Loading the files please wait ....