{"id":50884620,"url":"https://github.com/codebar-ag/laravel-odoo","last_synced_at":"2026-06-15T16:02:26.743Z","repository":{"id":363304964,"uuid":"1262629287","full_name":"codebar-ag/laravel-odoo","owner":"codebar-ag","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-08T09:51:23.000Z","size":40,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-08T11:18:57.803Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codebar-ag.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"vendor_name"}},"created_at":"2026-06-08T07:04:11.000Z","updated_at":"2026-06-08T09:25:00.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/codebar-ag/laravel-odoo","commit_stats":null,"previous_names":["codebar-ag/laravel-odoo"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/codebar-ag/laravel-odoo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebar-ag%2Flaravel-odoo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebar-ag%2Flaravel-odoo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebar-ag%2Flaravel-odoo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebar-ag%2Flaravel-odoo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codebar-ag","download_url":"https://codeload.github.com/codebar-ag/laravel-odoo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebar-ag%2Flaravel-odoo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34369850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-15T16:02:25.743Z","updated_at":"2026-06-15T16:02:26.728Z","avatar_url":"https://github.com/codebar-ag.png","language":"PHP","funding_links":["https://github.com/sponsors/vendor_name"],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://banners.beyondco.de/Laravel%20Odoo.png?theme=light\u0026packageManager=composer+require\u0026packageName=codebar-ag%2Flaravel-odoo\u0026pattern=circuitBoard\u0026style=style_1\u0026description=A+simple+way+to+interact+with+the+Odoo+API+in+Laravel\u0026md=1\u0026showWatermark=0\u0026fontSize=175px\u0026images=server\"\u003e\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/codebar-ag/laravel-odoo.svg?style=flat-square)](https://packagist.org/packages/codebar-ag/laravel-odoo)\n[![Total Downloads](https://img.shields.io/packagist/dt/codebar-ag/laravel-odoo.svg?style=flat-square)](https://packagist.org/packages/codebar-ag/laravel-odoo)\n[![GitHub-Tests](https://github.com/codebar-ag/laravel-odoo/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/codebar-ag/laravel-odoo/actions/workflows/run-tests.yml)\n[![GitHub Code Style](https://github.com/codebar-ag/laravel-odoo/actions/workflows/fix-php-code-style-issues.yml/badge.svg?branch=main)](https://github.com/codebar-ag/laravel-odoo/actions/workflows/fix-php-code-style-issues.yml)\n[![PHPStan](https://github.com/codebar-ag/laravel-odoo/actions/workflows/phpstan.yml/badge.svg)](https://github.com/codebar-ag/laravel-odoo/actions/workflows/phpstan.yml)\n[![Dependency Review](https://github.com/codebar-ag/laravel-odoo/actions/workflows/dependency-review.yml/badge.svg)](https://github.com/codebar-ag/laravel-odoo/actions/workflows/dependency-review.yml)\n\nThis package was developed to give you a quick start to communicate with the\nOdoo external API from Laravel. It wraps the most common endpoints — sessions,\nusers, employees, projects, tasks and timesheets — behind a clean, typed\nconnector built on [Saloon](https://docs.saloon.dev).\n\n⚠️ This package is not designed as a replacement of the official Odoo external API. See the [Odoo documentation](https://www.odoo.com/documentation) if you need further functionality. ⚠️\n\n## 📑 Table of Contents\n\n\u003c!-- TOC --\u003e\n- [What is Odoo?](#-what-is-odoo)\n- [Requirements](#-requirements)\n- [Installation](#️-installation)\n- [Configuration](#-configuration)\n  - [Environment Variables](#environment-variables)\n- [Basic Usage](#-basic-usage)\n- [API Reference](#-api-reference)\n  - [Session](#session)\n  - [User](#user)\n  - [Employees](#employees)\n  - [Fields](#fields)\n  - [Permissions](#permissions)\n  - [Projects](#projects)\n  - [Tasks](#tasks)\n  - [Timesheets](#timesheets)\n  - [Sync All](#sync-all)\n- [DTOs](#-dtos)\n- [Testing](#-testing)\n- [Changelog](#-changelog)\n- [Contributing](#️-contributing)\n- [Security Vulnerabilities](#-security-vulnerabilities)\n- [Credits](#-credits)\n- [License](#-license)\n\u003c!-- TOC --\u003e\n\n## 💡 What is Odoo?\n\nOdoo is an open-source suite of business applications covering CRM, sales,\nproject management, timesheets, accounting, inventory and more. It exposes an\nexternal API that lets you read and write records across all of these modules.\nThis package provides a typed, Laravel-friendly client for the most common Odoo\nendpoints used in day-to-day integrations.\n\n## 🛠 Requirements\n\n| Package  | PHP          | Laravel |\n|----------|--------------|---------|\n| v1.0.0   | ^8.4         | ^13.0   |\n\n## ⚙️ Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require codebar-ag/laravel-odoo\n```\n\n## 🔧 Configuration\n\nOptionally publish the config file to adjust defaults:\n\n```bash\nphp artisan vendor:publish --provider=\"CodebarAg\\Odoo\\OdooServiceProvider\" --tag=\"laravel-odoo-config\"\n```\n\nYou can generate an API key in your Odoo user profile under **Preferences → API Keys**.\n\n### Environment Variables\n\nAdd the following variables to your `.env` file:\n\n```dotenv\nLARAVEL_ODOO_URL=https://your-odoo-instance.com\nLARAVEL_ODOO_API_KEY=your-api-key\nLARAVEL_ODOO_DB=your-database\n```\n\n### Response Caching\n\nRead-only requests (`search_read`, health, version, …) are cached through\n[Saloon's cache plugin](https://github.com/saloonphp/cache-plugin) using your\nLaravel cache store. Write requests (create/update/delete) are never cached.\n\n```dotenv\n# Any Laravel cache store; defaults to your CACHE_STORE, then \"file\"\nLARAVEL_ODOO_CACHE_DRIVER=file\n# Time-to-live in seconds (default 60)\nLARAVEL_ODOO_CACHE_LIFETIME_IN_SECONDS=60\n```\n\nCaching is opt-in per request and enabled by default on every read request. To\nbypass or refresh the cache for a single call, use the cache-plugin helpers on\nthe request:\n\n```php\n$request-\u003edisableCaching();   // skip the cache for this request\n$request-\u003einvalidateCache();  // force a fresh response and re-cache it\n```\n\n## 🚀 Basic Usage\n\nCreate an `OdooConnector` instance with your Odoo URL, API key, and optionally a database name:\n\n```php\nuse CodebarAg\\Odoo\\OdooConnector;\n\n$connector = new OdooConnector(\n    baseUrl: 'https://your-odoo-instance.com',\n    apiKey: 'your-api-key',\n    db: 'your-database', // optional\n);\n```\n\nEach method returns a typed response object with dedicated methods for accessing the data.\n\n### Using the Facade\n\nIf you set the environment variables above (or publish and edit the config file), the package binds a pre-configured `OdooConnector` in the container, so you can resolve it or use the `Odoo` facade instead of constructing it by hand:\n\n```php\nuse CodebarAg\\Odoo\\Facades\\Odoo;\n\n$response = Odoo::health();\n$response-\u003eisHealthy(); // bool\n```\n\nThe facade reads `url`, `api_key`, and `db` from `config/laravel-odoo.php`. Direct instantiation with `new OdooConnector(...)` remains fully supported — for example when you need to talk to more than one Odoo instance.\n\n## 📖 API Reference\n\n### Session\n\n```php\n// Check if the Odoo instance is reachable\n$response = $connector-\u003ehealth();\n$response-\u003eisHealthy(); // bool\n\n// Get the Odoo server version\n$response = $connector-\u003eversion();\n$response-\u003eserverVersion(); // ?string  e.g. \"17\"\n$response-\u003eserie();         // ?string  e.g. \"17.0\"\n\n// List all available databases\n$response = $connector-\u003edatabases();\n$response-\u003edatabases(); // array\u003cstring\u003e\n```\n\n### User\n\n```php\n// Get the currently authenticated user\n$response = $connector-\u003egetUser();\n$user = $response-\u003edto(); // ?UserDto  (id, name, lang)\n```\n\n### Employees\n\n```php\n// Get an employee by their Odoo user ID\n$response = $connector-\u003egetEmployeeByUserId(\n    userId: 1,\n    fields: ['name', 'job_title'], // optional — omit to get all fields\n);\n$response-\u003edto(); // ?EmployeeDto\n```\n\n### Fields\n\n```php\n// Get fields for a specific model\n$response = $connector-\u003egetFields(\n    model: 'account.move',\n    attributes: ['string', 'type'], // optional — field meta-attributes to return\n);\n$response-\u003efields(); // array\u003cstring, FieldDto\u003e\n\n// Get all fields across all models\n$response = $connector-\u003egetAllFields();\n$response-\u003efields(); // array\u003cstring, FieldDto\u003e\n```\n\n### Permissions\n\n```php\n// Check permissions for a model and operation\n$response = $connector-\u003egetPermissions(\n    model: 'project.project',\n    operation: 'read', // read, write, create, unlink\n);\n$response-\u003eallowed(); // bool\n```\n\n### Projects\n\n```php\n$response = $connector-\u003egetProjects(\n    fields: ['name', 'date_start', 'date'], // optional\n    domain: [['active', '=', true]],        // optional Odoo domain filter\n    limit: 100,                              // optional, default 100\n);\n\n/** @var array\u003cProjectDto\u003e $projects */\n$projects = $response-\u003eprojects();\n```\n\n### Tasks\n\n```php\n// Get all tasks\n$response = $connector-\u003egetAllTasks(\n    fields: ['name', 'project_id', 'stage_id'], // optional\n    domain: [['active', '=', true]],             // optional\n    limit: 100,                                   // optional, default 100\n);\n\n/** @var array\u003cTaskDto\u003e $tasks */\n$tasks = $response-\u003etasks();\n\n// Get tasks for a specific project\n$response = $connector-\u003egetTasksByProject(\n    projectId: 42,\n    fields: ['name', 'stage_id', 'date_deadline'], // optional\n);\n\n/** @var array\u003cTaskDto\u003e $tasks */\n$tasks = $response-\u003etasks();\n```\n\n### Timesheets\n\n```php\nuse CodebarAg\\Odoo\\Dto\\Timesheets\\CreateTimesheetDto;\nuse CodebarAg\\Odoo\\Dto\\Timesheets\\UpdateTimesheetDto;\n\n// Get timesheet entries\n$response = $connector-\u003egetTimesheetEntries(\n    fields: ['name', 'project_id', 'task_id', 'unit_amount', 'date'], // optional\n    domain: [['employee_id', '=', 5]],                                 // optional\n    limit: 100,                                                         // optional\n);\n\n/** @var array\u003cTimesheetEntryDto\u003e $entries */\n$entries = $response-\u003eentries();\n\n// Get timesheet entries from the last N days\n$response = $connector-\u003egetTimesheetEntriesLastDays(days: 7);\n$entries = $response-\u003eentries(); // array\u003cTimesheetEntryDto\u003e\n\n// Read a single timesheet entry\n$response = $connector-\u003ereadTimesheet(id: 123);\n$entry = $response-\u003edto(); // ?TimesheetEntryDto\n\n// Create a timesheet entry\n$response = $connector-\u003ecreateTimesheet(new CreateTimesheetDto(\n    name: 'Fixed bug #456',\n    projectId: 1,\n    taskId: 10,\n    date: '2024-06-11',\n    unitAmount: 1.5,\n    employeeId: 5,   // optional\n    extraValues: [], // optional — extra Odoo fields (e.g. custom Studio fields)\n));\n$newId = $response-\u003eid(); // ?int\n\n// Update a timesheet entry\n$response = $connector-\u003eupdateTimesheet(new UpdateTimesheetDto(\n    id: 123,\n    values: ['name' =\u003e 'Updated description', 'unit_amount' =\u003e 2.0],\n));\n$response-\u003eok(); // bool\n\n// Delete a timesheet entry\n$response = $connector-\u003edeleteTimesheet(id: 123);\n$response-\u003eok(); // bool\n```\n\n### Sync All\n\nFetch projects, all tasks, and all timesheet entries in one call:\n\n```php\n$results = $connector-\u003esyncAll();\n\n$projects   = $results['projects']-\u003eprojects();     // array\u003cProjectDto\u003e\n$tasks      = $results['tasks']-\u003etasks();           // array\u003cTaskDto\u003e\n$timesheets = $results['timesheets']-\u003eentries();    // array\u003cTimesheetEntryDto\u003e\n```\n\n## 📦 DTOs\n\nRead DTOs are built on [spatie/laravel-data](https://spatie.be/docs/laravel-data).\nOdoo's relation tuples (`[id, name]`) are flattened onto paired properties\n(e.g. `projectId` / `projectName`) and its `false`-means-empty sentinel is\nnormalised to `null`. Each DTO keeps a `fromArray()` factory for backwards\ncompatibility and is also a full laravel-data `Data` object (`from()`, `collect()`, …).\n\n| DTO                  | Description                                    |\n|----------------------|------------------------------------------------|\n| `ProjectDto`         | Represents an Odoo project                     |\n| `TaskDto`            | Represents an Odoo task                        |\n| `TimesheetEntryDto`  | Represents a timesheet entry (read)            |\n| `CreateTimesheetDto` | Payload for creating a timesheet entry         |\n| `UpdateTimesheetDto` | Payload for updating a timesheet entry         |\n| `EmployeeDto`        | Represents an Odoo employee                    |\n| `UserDto`            | Represents the authenticated Odoo user         |\n| `FieldDto`           | Represents a field definition on an Odoo model |\n\n## 🧪 Testing\n\n```bash\ncomposer test\n```\n\nFor live integration tests against a real Odoo instance, copy `phpunit.xml.dist` to `phpunit.xml`, fill in the `LARAVEL_ODOO_URL`, `LARAVEL_ODOO_API_KEY` and `LARAVEL_ODOO_DB` env values, then run:\n\n```bash\ncomposer test:live\n```\n\n## 📝 Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## ✏️ Contributing\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.\n\n## 🧑‍💻 Security Vulnerabilities\n\nPlease review [our security policy](.github/SECURITY.md) on how to report security vulnerabilities.\n\n## 🙏 Credits\n\n- [Sebastian Bürgin-Fix](https://github.com/StanBarrows)\n- [Tobias Brogle](https://github.com/Astro2006)\n- [All Contributors](../../contributors)\n- [Skeleton Repository from Spatie](https://github.com/spatie/package-skeleton-laravel)\n- [Laravel Package Training from Spatie](https://spatie.be/videos/laravel-package-training)\n\n## 🎭 License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebar-ag%2Flaravel-odoo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodebar-ag%2Flaravel-odoo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebar-ag%2Flaravel-odoo/lists"}