{"id":37003932,"url":"https://github.com/peter9x/laravel-bc","last_synced_at":"2026-01-14T00:35:55.769Z","repository":{"id":309770594,"uuid":"1037501116","full_name":"peter9x/laravel-bc","owner":"peter9x","description":"Laravel package for Microsoft Business Central API","archived":false,"fork":false,"pushed_at":"2025-09-17T15:23:17.000Z","size":105,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-26T03:53:53.291Z","etag":null,"topics":["businesscentral","laravel","microsoft"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peter9x.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-08-13T17:05:10.000Z","updated_at":"2025-09-17T15:17:12.000Z","dependencies_parsed_at":"2025-08-13T19:29:02.246Z","dependency_job_id":"c81e01e8-2d4a-4a40-a0bb-ecdbc8e0c000","html_url":"https://github.com/peter9x/laravel-bc","commit_stats":null,"previous_names":["peter9x/laravel-bc"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/peter9x/laravel-bc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter9x%2Flaravel-bc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter9x%2Flaravel-bc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter9x%2Flaravel-bc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter9x%2Flaravel-bc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peter9x","download_url":"https://codeload.github.com/peter9x/laravel-bc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter9x%2Flaravel-bc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28406520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["businesscentral","laravel","microsoft"],"created_at":"2026-01-14T00:35:55.251Z","updated_at":"2026-01-14T00:35:55.752Z","avatar_url":"https://github.com/peter9x.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/peter9x/laravel-bc/actions\"\u003e\u003cimg src=\"https://github.com/peter9x/laravel-bc/actions/workflows/php.yml/badge.svg\" alt=\"Build Status\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/peter9x/laravel-bc\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/peter9x/laravel-bc\" alt=\"Latest Stable Version\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/peter9x/laravel-bc\"\u003e\u003cimg src=\"https://img.shields.io/packagist/l/peter9x/laravel-bc\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Laravel Business Central\n\nA Laravel package for integrating with the **Microsoft Business Central API**.\n\n## Installation\n\n1. Install the package via Composer:\n\n```bash\ncomposer require peter9x/laravel-bc\n```\n\n2. Publish the configuration file:\n\n```bash\nphp artisan vendor:publish --provider=\"Mupy\\\\BusinessCentral\\\\BusinessCentralServiceProvider\" --tag=config\n```\n\n3. Add the following to your `.env` file:\n\n\u003e **Note:** `BC_COMPANY_ID` is **optional**.  \n\u003e If not set, you will need to select a company in your code after retrieving the list of companies (see the usage example).\n\n```env\nBC_CLIENT_ID=your-client-id\nBC_CLIENT_SECRET=your-client-secret\nBC_TENANT_ID=your-tenant-id\n# Optional: if not set, select the company in your script\nBC_COMPANY_ID=your-company-id\nBC_ENVIRONMENT=sandbox\n```\n\n## Usage\n\n```php\nuse Mupy\\BusinessCentral\\Facades\\BusinessCentral;\nuse Mupy\\BusinessCentral\\EndPoint\\Company;\nuse Mupy\\BusinessCentral\\EndPoint\\SalesInvoices;\n\n$api = BusinessCentral::getClient();\n\n// Change the environment dynamically if needed\n$api-\u003eselectEnv('sandbox');\n\ntry {\n    $result = $api-\u003eget(Company::class);\n\n    if ($result-\u003esuccess()) {\n        foreach ($result-\u003edata() as $entry) {\n            // Select the company dynamically if BC_COMPANY_ID is not set in .env\n            $company = $api-\u003euseCompany($entry['id']);\n            $company-\u003eget(SalesInvoices::class);\n        }\n    }\n} catch (\\Throwable $th) {\n    // Handle exceptions as needed\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeter9x%2Flaravel-bc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeter9x%2Flaravel-bc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeter9x%2Flaravel-bc/lists"}