PHPackages                             gilangwinduasmara/laravel-odoo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. gilangwinduasmara/laravel-odoo

ActiveLibrary[API Development](/categories/api)

gilangwinduasmara/laravel-odoo
==============================

A Laravel package to easily integrate with Odoo via XML-RPC.

v1.0.0(10mo ago)217MITPHPPHP ^8.2

Since Jun 20Pushed 10mo agoCompare

[ Source](https://github.com/gilangwinduasmara/laravel-odoo)[ Packagist](https://packagist.org/packages/gilangwinduasmara/laravel-odoo)[ RSS](/packages/gilangwinduasmara-laravel-odoo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Laravel Odoo Api
================

[](#laravel-odoo-api)

Laravel 11 and higher

Laravel 8 and higher

Odoo 8.0 and higher

Php 8.2 and higher

---

🔧 Setup
-------

[](#-setup)

This package depends on the PHP `xmlrpc` extension, which is **not available by default in PHP 8.3**. You need to install it manually to ensure the package works correctly.

---

### 🪟 Windows

[](#-windows)

1. Download the prebuilt DLL from the official PHP archives: 👉 [xmlrpc-1.0.0RC3 for Windows](https://downloads.php.net/~windows/pecl/releases/xmlrpc/1.0.0RC3)
2. Add the `.dll` to your PHP `ext` directory.
3. Enable it by adding this line to your `php.ini`:

    ```
    extension=php_xmlrpc.dll
    ```
4. Restart your web server or PHP process.

---

### 🐧 Ubuntu (PHP 8.3)

[](#-ubuntu-php-83)

#### 📦 Standard installation

[](#-standard-installation)

```
sudo apt-get update
sudo apt-get install -y libexpat1
sudo pecl install channel://pecl.php.net/xmlrpc-1.0.0RC3
echo "extension=xmlrpc.so" | sudo tee /etc/php/8.3/mods-available/xmlrpc.ini
sudo phpenmod xmlrpc
sudo systemctl restart apache2 # or php-fpm, depending on your setup
php -m | grep xmlrpc # confirm the extension is loaded
```

---

### 🛠 Manual Compilation (if `undefined symbol: XML_ParserCreate` error appears)

[](#-manual-compilation-if-undefined-symbol-xml_parsercreate-error-appears)

If you see this error when running your app:

```
symbol lookup error: /usr/lib/php/20230831/xmlrpc.so: undefined symbol: XML_ParserCreate

```

Follow these steps to build the extension manually:

#### 1. Download and extract the source:

[](#1-download-and-extract-the-source)

```
pecl download xmlrpc-1.0.0RC3
tar -xf xmlrpc-1.0.0RC3.tgz
cd xmlrpc-1.0.0RC3
```

#### 2. Prepare and compile:

[](#2-prepare-and-compile)

```
phpize
./configure --with-expat
make
sudo make install
```

#### 3. Enable and restart PHP:

[](#3-enable-and-restart-php)

```
echo "extension=xmlrpc.so" | sudo tee /etc/php/8.3/mods-available/xmlrpc.ini
sudo phpenmod xmlrpc
sudo systemctl restart apache2 # or php-fpm
```

#### 4. Confirm it's working:

[](#4-confirm-its-working)

```
php -m | grep xmlrpc
ldd /usr/lib/php/20230831/xmlrpc.so | grep expat
```

---

### 🧯 If you get a `libxml/parser.h` error during compilation

[](#-if-you-get-a-libxmlparserh-error-during-compilation)

```
fatal error: libxml/parser.h: No such file or directory

```

Install the required development headers:

```
sudo apt-get update
sudo apt-get install -y libxml2-dev
```

If the issue persists, run:

```
cd /usr/include/libxml2
sudo cp -R libxml/ ../
```

---

Installation
------------

[](#installation)

This package is installed via [Composer](https://getcomposer.org/). To install, run the following command.

```
composer require gilangwinduasmara/laravel-odoo

```

Publish the package's configuration file to the application's own config directory

```
php artisan vendor:publish --provider="GilangWinduAsmara\LaravelOdoo\Providers\OdooServiceProvider" --tag="config"
```

This package supports autodiscover.

If you don't use autodiscover for reasons, you can add the provider as described below.

Register Laravel Odoo Api service by adding it to the providers array.

```
'providers' => array(
        ...
        GilangWinduAsmara\LaravelOdoo\Providers\OdooServiceProvider::class
    )
```

You can also add the Alias facade.

```
'aliases' => array(
        ...
        'Odoo' => GilangWinduAsmara\LaravelOdoo\Facades\Odoo::class,
    )
```

### Configuration

[](#configuration)

After publishing the package config file, the base configuration for laravel-odoo-api package is located in config/laravel-odoo-api.php

Also, you can dynamically update those values calling the available setter methods:

`host($url)`, `username($username)`, `password($password)`, `database($name)`, `apiSuffix($name)`

Usage samples
-------------

[](#usage-samples)

Instance the main Odoo class:

```
$odoo = new \GilangWinduAsmara\LaravelOdoo\Odoo();
```

You can get the Odoo API version just calling the version method:

```
$version = $odoo->version();
```

> This methods doesn't require to be connected/Logged into the ERP.

Connect and log into the ERP:

```
$odoo = $odoo->connect();
```

All needed configuration data is taken from `laravel-odoo-api.php` config file. But you always may pass new values on the fly if required.

```
$this->odoo = $this->odoo
            ->username('my-user-name')
            ->password('my-password')
            ->database('my-db')
            ->host('https://my-host.com')
            ->connect();
```

> // Note: `host` should contain 'http://' or 'https://'

After login, you can check the user identifier like follows:

```
$userId = $this->odoo->getUid();
```

You always can check the permission on a specific model:

```
$can = $odoo->can('read', 'res.partner');
```

> Permissions which can be checked: 'read','write','create','unlink'

Method `search provides a collection of ids based on your conditions:

```
$ids = $odoo
    ->model('res.partner')
    ->where('customer', '=', true)
    ->search();
```

You can limit the amount of data using `limit` method and use as many as condition you need:

```
$ids = $odoo
    ->model('res.partner')
    ->where('is_company', true)
    ->where('customer', '=', true)
    ->limit(3)
    ->search();
```

If need to get a list of models, use the `get` method:

```
$models = $odoo
    ->model('res.partner')
    ->where('customer', true)
    ->limit(3)
    ->get();
```

Instead of retrieving all properties of the models, you can reduce it by adding `fields` method before the method `get`

```
$models = $odoo
    ->model('res.partner')
    ->where('customer', true)
    ->limit(3)
    ->fields(['name'])
    ->get();
```

If not sure about what fields a model has, you can retrieve the model structure data by calling `fieldsOf` method:

```
$structure = $odoo
    ->model('res.partner')
    ->listModelFields();
```

Till now we have only retrieved data from Odoo but you can also Create and Delete records.

In order to create a new record just call `create` method as follows:

```
$id = $odoo
    ->model('res.partner')
    ->create(['name' => 'Bobby Brown']);
```

> The method returns the id of the new record.

For Deleting records we have the `delete` method:

```
$result = $odoo
    ->model('res.partner')
    ->where('name', '=', 'Bobby Brown')
    ->delete();
```

> Notice that before calling `delete` method you have to use `where`.

You can also remove records by ids like follows:

```
$result = $odoo
    ->model('res.partner')
    ->deleteById($ids);
```

Update any record of your Odoo:

```
$updateSuccessfull = $odoo
    ->model('res.partner')
    ->where('name', '=', 'Bobby Brown')
    ->update(['name' => 'Dagobert Duck','email' => 'daduck@odoo.com']);
```

Notice that all `delete` and `update` methods always returns `true` except if there was an error.

Custom api Calls are also supported

```
$ids = $odoo
    ->model('res.partner')
    ->setMethod('search')
    ->setArguments([[
        ['is_company', '=', true]
    ]])
    ->setOption('limit', 3)
    ->addResponseClass(Odoo\Response\ListResponse::class)
    ->get();
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance53

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

326d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8b5dd1426ad326b2cd14a822a6ad552ffca0fbf8bcc7721353d7c5191d39a1f4?d=identicon)[gilangwinduasmara](/maintainers/gilangwinduasmara)

---

Top Contributors

[![gilangwinduasmara](https://avatars.githubusercontent.com/u/25945642?v=4)](https://github.com/gilangwinduasmara "gilangwinduasmara (1 commits)")

---

Tags

laravelodooxmlrpcintegrationERP

### Embed Badge

![Health badge](/badges/gilangwinduasmara-laravel-odoo/health.svg)

```
[![Health](https://phpackages.com/badges/gilangwinduasmara-laravel-odoo/health.svg)](https://phpackages.com/packages/gilangwinduasmara-laravel-odoo)
```

###  Alternatives

[edujugon/laradoo

Odoo ERP API for Laravel

16468.6k](/packages/edujugon-laradoo)[tbondois/odoo-ripcord

Ripoo : a PHP8 XML-RPC client handler for Odoo External API

16124.3k1](/packages/tbondois-odoo-ripcord)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
