Download the PHP package gilangwinduasmara/laravel-odoo without Composer
On this page you can find all versions of the php package gilangwinduasmara/laravel-odoo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gilangwinduasmara/laravel-odoo
More information about gilangwinduasmara/laravel-odoo
Files in gilangwinduasmara/laravel-odoo
Package laravel-odoo
Short Description A Laravel package to easily integrate with Odoo via XML-RPC.
License MIT
Informations about the package laravel-odoo
Laravel Odoo Api
Laravel 11 and higher
Laravel 8 and higher
Odoo 8.0 and higher
Php 8.2 and higher
🔧 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
- Download the prebuilt DLL from the official PHP archives: 👉 xmlrpc-1.0.0RC3 for Windows
- Add the
.dllto your PHPextdirectory. -
Enable it by adding this line to your
php.ini: - Restart your web server or PHP process.
🐧 Ubuntu (PHP 8.3)
📦 Standard installation
🛠 Manual Compilation (if undefined symbol: XML_ParserCreate error appears)
If you see this error when running your app:
Follow these steps to build the extension manually:
1. Download and extract the source:
2. Prepare and compile:
3. Enable and restart PHP:
4. Confirm it's working:
🧯 If you get a libxml/parser.h error during compilation
Install the required development headers:
If the issue persists, run:
Installation
This package is installed via Composer. To install, run the following command.
Publish the package's configuration file to the application's own config directory
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.
You can also add the Alias facade.
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
Instance the main Odoo class:
You can get the Odoo API version just calling the version method:
This methods doesn't require to be connected/Logged into the ERP.
Connect and log into the ERP:
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.
// Note:
hostshould contain 'http://' or 'https://'
After login, you can check the user identifier like follows:
You always can check the permission on a specific model:
Permissions which can be checked: 'read','write','create','unlink'
Method `search provides a collection of ids based on your conditions:
You can limit the amount of data using limit method and use as many as condition you need:
If need to get a list of models, use the get method:
Instead of retrieving all properties of the models, you can reduce it by adding fields method before the method get
If not sure about what fields a model has, you can retrieve the model structure data by calling fieldsOf method:
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:
The method returns the id of the new record.
For Deleting records we have the delete method:
Notice that before calling
deletemethod you have to usewhere.
You can also remove records by ids like follows:
Update any record of your Odoo:
Notice that all delete and update methods always returns true except if there was an error.
Custom api Calls are also supported