便携式/eloquent-zoho

此软件包最新版本(v1.0.10)没有可用的许可证信息。

Zoho Analytics的简单Eloquent驱动程序

v1.0.10 2023-09-27 06:21 UTC

README

CI

Eloquent Zoho

此软件包提供了一个基本的(即远未完整)Zoho API实现,作为Laravel的Eloquent驱动程序,以使用Zoho数据模型作为eloquent模型。

config/databases.php 中的数据库定义需要提供以下配置值

'driver' => 'zoho',
'host' => // the base URL for your Zoho workspace, e.g. 'bi.myorg.com',
'port' => // Usually 443, assuming you have SSL for your workspace,
'username' => // the API email for your zoho workspace,
'database' => // The workspace name,
'prefix' => // The folder where your tables are stored within Zoho.  This is used when manipulating data schemas using ZohoSchema
'email' => // Your *user* email, used for generating tokens
'password' => // Your *user* password, used for generating tokens

驱动程序假设您的数据库连接密钥为'zoho'。

(例如,在 config/database.php 中,您将使用配置定义 connections['zoho'])。

数据库模式

您可以使用 ZohoSchema 门面像通常一样创建和操作模式。

use Portable\EloquentZoho\Eloquent\Facades\ZohoSchema;

ZohoSchema::hasTable('my_zoho_table')

// or

ZohoSchema::create('my_zoho_table', function(Blueprint $table){
    $table->id();
    $table->timestamps();
});

模型定义

模型应定义为 Portable\EloquentZoho\Eloquent\ZohoModel 的子类。

模型目前支持基本的查询、插入、更新和删除,以及upserts。

欢迎PRs!

如上所述,此驱动程序是基本的,并针对特定用例编写的。因此,许多可能的语法尚未实现,欢迎提交PRs。