Download the PHP package oscar-team/odoo-json2 without Composer

On this page you can find all versions of the php package oscar-team/odoo-json2. 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 odoo-json2

Odoo JSON-2 PHP Client

A modern PHP client library for interacting with Odoo's JSON-2 API (Odoo 19+). This library provides a clean, type-safe interface for performing CRUD operations and calling custom methods on Odoo models.

Features

Requirements

Installation

Laravel Integration

This package is designed to work seamlessly with Laravel. The service provider is automatically discovered, so no manual registration is required.

Publishing Configuration

After installing the package, publish the configuration file:

This will create a config/odoo.php file in your Laravel application.

Environment Configuration

Add the following environment variables to your .env file:

Using the Odoo Client in Laravel

The package automatically registers the Odoo class as a singleton, so you can use it via dependency injection:

Or resolve it from the service container:

Using Models in Laravel

Models are automatically booted when the service provider loads. You can use them directly:

Configuration File

The published configuration file (config/odoo.php) contains the following options:

All values can be overridden via environment variables.

Configuration

Getting Your API Key

  1. Log in to your Odoo instance
  2. Go to SettingsUsers & CompaniesAPI Keys
  3. Create a new API key
  4. Copy the generated API key

Usage

Basic Setup

Search Records

Read Records

Search and Read

Create Records

Update Records

Delete Records

Count Records

Get Model Fields

Custom Method Calls

Error Handling

Advanced Configuration

Domain Syntax

The domain syntax follows Odoo's standard format:

Examples

Working with Sales Orders

Working with Products

Eloquent-like Models

This library provides an Eloquent-like ORM for working with Odoo models, making it easy to define models with relationships and perform type-safe operations.

Basic Model Definition

Field Attributes

Use the #[Field] attribute to map Odoo fields to PHP properties:

Many-to-One Relationships (BelongsTo)

Use #[Key] to extract the ID and #[BelongsTo] to define the relationship:

One-to-Many Relationships (HasMany)

Complete Model Example

Initializing Models

Before using models, you need to boot the Odoo instance:

Querying with Models

Creating Records

Updating Records

Deleting Records

Working with Relationships

Advanced Queries

Real-World Examples

Example 1: Create a Partner with Relationships

Example 2: Find and Update Products

Example 3: Working with Invoices

Example 4: Hierarchical Partners

Testing

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This library is open-sourced software licensed under the MIT license.

Support

For issues, questions, or contributions, please open an issue on GitHub.


All versions of odoo-json2 with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
guzzlehttp/guzzle Version ^7.8
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 oscar-team/odoo-json2 contains the following files

Loading the files please wait ...