Download the PHP package tamedevelopers/database without Composer

On this page you can find all versions of the php package tamedevelopers/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

PHP ORM Database

Total Downloads Latest Stable Version License Code Coverage Gitter

Inspiration

Having been introduced to learning Laravel Framework; Over the past yr(s), Coming back to vanilla PHP, was pretty tough. So i decided to create a much more easier way of communicating with Database, using native PHP PDO:: Driver.

Documentation

Requirements

Installation

Prior to installing database package get the Composer dependency manager for PHP because it'll simplify installation.

Instantiate

Step 1Require composer autoload:

Step 2 — Call the below method() and Run once in browser

Description
It's important to install vendor in your project root, As we use this to get your root [dir]
By default you don't need to define any path again
Files you'll see after you reload browser:
.env .env.example .gitignore .htaccess .user.ini init.php

Init.php File

Description
Once application is started! You can choose to include the init.php
The file includes all configuration needed and as well extends the vendor/autoload.php path.

BootLoader

Database Connection

Database Disconnect

Database Reconnect

App Debug Env

key Type Default Value
APP_DEBUG boolean true

More Database Connection Keys

key Type Default Value
driver string mysql
host string localhost
port int 3306
database string
username string
password string
charset string utf8mb4
collation string utf8mb4_unicode_ci
prefix string
prefix_indexes bool false

Usage

Table

Insert

Insert Or Ignore

Update

Update Or Ignore

Delete

Increment

param Data types
column required string
count or [] int | array
param array

1 By default if the the second param not passed, this will increment by 1

Decrement

Fetching Data

object name Returns
get() array of objects
find() object | null
first() object | null
FirstOrIgnore() object | null
FirstOrCreate() object
firstOrFail() object or exit with 404 status
count() int
paginate() array of objects
exists() boolean true | false
tableExists() boolean true | false

GET

First

First or Create

First or Fail

Count

Paginate

Exists

Table Exists

Collections

Collection Methods

Methods Description
getAttributes() array Returns an array of data
getOriginal() object Returns an object of data
isEmpty() boolean true \| false If data is empty
isNotEmpty() opposite of ->isEmpty()
count() int count data in items collection
toArray() array Convert items to array
toObject() object Convert items to object
toJson() string Convert items to json

Collection Usage

Pagination

key Data Type Description
allow true | false Default false Setting to true will allow the system use this settings across app
class string Css selector For pagination ul tag in the browser
span string Default .page-span Css selector For pagination Showing Span tags in the browser
view bootstrap | simple | cursor Default simple - For pagination design
first string Change the letter First
last string Change the letter Last
next string Change the letter Next
prev string Change the letter Prev
showing string Change the letter Showing
of string Change the letter of
results string Change the letter results
buttons int Numbers of pagination links to generate. Default is 5 and limit is 20

Global Configuration

Pagination Query

Pagination Data

Pagination Links

Pagination Links Config

Read more... - You can directly configure pagination links - Note: If `configPagination()` `allow` is set to `true` - It'll override every other settings

Pagination Showing

Pagination Showing Config

Read more... - You can configure showing text directly as well

Pagination Foreach Numbers

Get Pagination

key Description
limit Pagination limit int
offset Pagination offset int
page Pagination Current page int
pageCount Pagination Total page count int
perPage Pagination per page count int
totalCount Pagination total items count int

Clause

Query

Select

orderBy

orderByRaw

Latest

Oldest

inRandomOrder

random

Read more... - Same as `inRandomOrder()`

limit

offset

Read more... - Takes one param `$offset` as int. By default value is `0` - Example 2 (Providing only offset will return as LIMIT without error)

join

Params Description
table table
foreignColumn table.column
operator operator sign
localColumn local_table.column

leftJoin

where

param Data types
column string
operator string
value string

orWhere

Read more... - Same as Where clause

whereRaw

whereColumn

whereNull

whereNotNull

Read more... - Takes one parameter `column`

whereBetween

param Data types Value
column string column_name
param array [10, 100]

whereNotBetween

Read more... - Same as `whereBetween()` method

whereIn

param Data types Value
column string column_name
param array [0, 20, 80]

whereNotIn

Read more... Same as `whereIn()` method

groupBy

Database Migration

object name Returns
create() Create table schema
run() Begin migration
drop() Drop migration tables

Create Table Schema

Sample Session Schema

Default String Length

Description
The Default Set is 255 But you can override by setting custom value
According to MySql v:5.0.0 Maximum allowed legnth is 4096 chars
If provided length is more than that, then we'll revert to default as the above
This affects only VACHAR
You must define this before start using the migrations

Update Column Default Value

Run Migration

Drop Migration

Read more... - Be careful as this will execute and drop all files table `located in the migration` - [optional param] `bool` to force delete of tables

Drop Table

Read more... - Takes one param as `string` $table_name

Drop Column

Read more... - To Drop Column `takes two param` - This will drop the column available

Get Database Config

Get Database Connection

Get Database Name

Get Database PDO

Get Database TablePrefix

Database Import

Update Env Variable

Params Description
key ENV key
value ENV value
allow_quote true | false - Default is true (Allow quotes within value)
allow_space true | false - Default is false (Allow space between key and value)

Collation And Charset

Collation

Charset

Extend Model Class

Read more... - You can as well extends the DB Model class directly from other class

Helpers Functions

function name Description
db() Return instance of new DB($options) class
db_connection() Same as $db->dbConnection()
config_pagination() Same as $db->configPagination() or AutoLoader::configPagination
autoloader_start() Same as AutoLoader::start()
env_update() Same as Env::updateENV method
app_manager() Return instance of (new AppManager) class
import() Return instance of (new DBImport)->import() method
migration() Return instance of (new Migration) class
schema() Return instance of (new Schema) class

Error Dump

function Description
dump Dump Data
dd Dump and Die

Error Status

Useful Links


All versions of database with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
tamedevelopers/support Version *
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 tamedevelopers/database contains the following files

Loading the files please wait ....