portable / eloquent-zoho
A rudimentary Eloquent driver for Zoho Analytics
Installs: 5 418
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 2
Open Issues: 0
Requires
- php: ^8.1
Requires (Dev)
- guzzlehttp/guzzle: ^7.8
- guzzlehttp/promises: ^2.0
- laravel/pint: ^1.12
- nunomaduro/larastan: ^2.6
- orchestra/testbench: ^8.10
- pestphp/pest: ^2.19
- pestphp/pest-plugin-laravel: ^2.2
- squizlabs/php_codesniffer: ^3.7
README
Eloquent Zoho
This package provides a rudimentary(aka, far from complete) implementation of the Zoho API as an Eloquent driver for Laravel, to enable the use of Zoho data models as eloquent models.
Database definitions in config/databases.php
need to provide the following configuration values
'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
The driver assumes that your database connection key is 'zoho'.
(E.g within config/database.php
, you will define connections['zoho']
with your config).
Database schema
You can create and manipulate Schemas as normal with the ZohoSchema
facade:
use Portable\EloquentZoho\Eloquent\Facades\ZohoSchema;
ZohoSchema::hasTable('my_zoho_table')
// or
ZohoSchema::create('my_zoho_table', function(Blueprint $table){
$table->id();
$table->timestamps();
});
Model definitions
Models should be defined as a subclass of Portable\EloquentZoho\Eloquent\ZohoModel
Models currently support basic query, insert, update and delete, as well as upserts.
PRs Welcome!
As stated, this driver is rudimentary and was written for a specific use case. As such, much of the possible grammar is left unimplemented, and PRs are welcome.