Download the PHP package roy404/eloquent without Composer
On this page you can find all versions of the php package roy404/eloquent. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download roy404/eloquent
More information about roy404/eloquent
Files in roy404/eloquent
Download roy404/eloquent
More information about roy404/eloquent
Files in roy404/eloquent
Vendor roy404
Package eloquent
Short Description Eloquent is the default ORM (Object-Relational Mapping). It provides a simple ActiveRecord implementation for working with your database. With Eloquent, you can define database models as classes, and interact with the database using these models, rather than writing raw SQL queries.
License MIT
Package eloquent
Short Description Eloquent is the default ORM (Object-Relational Mapping). It provides a simple ActiveRecord implementation for working with your database. With Eloquent, you can define database models as classes, and interact with the database using these models, rather than writing raw SQL queries.
License MIT
Please rate this library. Is it a good library?
Informations about the package eloquent
ELOQUENT CLASS
Install the bundle using Composer:
DOCUMENTATION
The Eloquent class is a database query builder that provides a fluent interface to create SQL queries.
Methods
table()
: Sets the table for the query.select()
: Adds a column to the select clause.where()
: Adds a where clause to the query.orWhere()
: Adds an OR where clause to the query.orderBy()
: Adds an order by clause to the query.offset()
: Adds an offset clause to the query.limit()
: Adds a limit clause to the query.create()
: Creates a new record in the database.replace()
: Replaces a record in the database.
Model
The Model class extends Eloquent and provides additional methods for interacting with database tables that correspond to models.
all(): array
: Retrieves all records from the database table.create(array $binds): int
: Creates a new record in the database table.replace(array $binds): int
: Replaces a record in the database table.find(int $id): array
: Retrieves a record by its primary key.select(...$columns): Eloquent
: Selects specific columns from the database table.where(string $column, mixed $operator_or_value, mixed $value = self::DEFAULT_VALUE): Eloquent
: Adds a where clause to the query.
Return Data
However, these functions are not yet fully implemented; you will need to complete them yourself.
lastID()
: int: Returns the last inserted ID from the database.fetch()
: array: Fetches all rows from the result set as an array of arrays.col()
: array: Fetches the first column of all rows from the result set as an array.field()
: mixed: Fetches a single field value from the first row of the result set.row()
: array: Fetches the first row from the result set as an associative array.count()
: int: Returns the number of rows affected by the last SQL statement.
Example Usage
YOU WILL NEED TO CHANGE THE LOGIC OF THE FUNCTION BELOW:
Illuminate\Databases\DB::run()
- We suggest you to create your own class that runs the query with the action provided in the Return Data list
.
All versions of eloquent with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.0
The package roy404/eloquent contains the following files
Loading the files please wait ....