Download the PHP package thoth-pharaoh/base-model-repository without Composer

On this page you can find all versions of the php package thoth-pharaoh/base-model-repository. 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 base-model-repository

基礎抽象類別供專案使用

版本匹配

Laravel package
8.X 1.X
9.X 2.X

AbstractBaseModel

使用方法

功能

AbstractBaseRepository

使用方法

取得所有資料

參數 說明 類型 範例 預設
$fields 要搜尋的欄位 array ['name', 'type'] ['*']
$eagerLoad 預載入關聯 array ['post', 'post.comment'] []

依搜尋條件取得資料(whereIn)

參數 說明 類型 範例 預設
$whereField 搜尋條件欄位名稱 string 'name' 'id'
$whereValue 搜尋條件資訊 array [1, 2, 3] []
$field 要搜尋的欄位 array ['id', 'name'] ['*']
$eagerLoad 預載入關聯 array ['post', 'post.comment'] []

取得單筆資料

參數 說明 類型 範例 預設
$id PK 123
$eagerLoad 預載入關聯 array ['post', 'post.comment'] []

取得單筆資料(單一搜尋條件)

參數 說明 類型 範例 預設
$where 搜尋條件資訊 array ['status', '=', 1]
$field 要搜尋的欄位 array ['id', 'name'] ['*']
$eagerLoad 預載入關聯 array ['post', 'post.comment'] []

完整範例

or

取得單筆資料 從寫入資料庫取得

參數 說明 類型 範例 預設
$id PK 123

取得單筆資料 從寫入資料庫取得 並加排他鎖

參數 說明 類型 範例 預設
$id PK 123

尋找在某個欄位有重複的數值及個數

參數 說明 類型 範例 預設
$field 要搜尋的欄位 string 'member_id'
$where 搜尋條件資訊 array ['status', '=', 1]
$havingCount 取多少以上 int 5 1

完整範例

新增資料

參數 說明 類型
$parametes 新增資料陣列 array

完整範例

新增多筆資料

參數 說明 類型
$parametes 新增資料陣列 array

完整範例

更新單筆資料

參數 說明 類型
$id PK
$parametes 更新資料陣列 array

完整範例

更新單筆資訊 根據指定欄位

參數 說明 類型
$where 搜尋條件資訊 array
$parametes 更新資料陣列 array

完整範例

更新多筆資料

參數 說明 類型 預設
$data 更新條件資料 array
$parameters 更新資料陣列 array
$field 更新條件名稱 string 'id'

完整範例

資料新增,存在則更新

參數 說明 類型
$where 搜尋條件資訊 array
$parametes 更新資料陣列 array

完整範例

批次更新 or 新增資料

參數 說明 類型
$parametes 更新資料陣列 array

完整範例

一次更新多筆數據

參數 說明 類型
$setField 欲更新的欄位名稱 string
$caseField 查詢依據欄位名稱 string
$setValue 愈設定的數值 array

完整範例

增加數量

參數 說明 類型
$where 搜尋條件資訊 array
$field 愈增加數量的欄位名稱 string
$num 愈增加的數量 int

完整範例

減少數量

參數 說明 類型
$where 搜尋條件資訊 array
$field 愈減少數量的欄位名稱 string
$num 愈減少的數量 int

完整範例

依條件刪除資料

參數 說明 類型
$where 搜尋條件資訊 array

完整範例

AbstractBaseScope

使用方法

參數 說明 類型 範例 預設
$scope scope名稱 AbstractBaseScope OrderScope
$params 過濾條件 array ['no' => 123]
$model 欲使用的model
(不給就使用原本$repository中的model)
array ['no' => 123] $repository中的model

完整範例

Helpers

使用方法

範例

輸出結果

範例

輸出結果


All versions of base-model-repository with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version >=9.0
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 thoth-pharaoh/base-model-repository contains the following files

Loading the files please wait ....