janyksteenbeek / laravel-moneybird-sync
One-way synchronization of customer fields towards Moneybird
Requires
- php: ^8.1
- illuminate/contracts: ^9.0|^10.0
- picqer/moneybird-php-client: ^0.34.1
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- spatie/laravel-ray: ^1.26
README
One-way synchronization of contact fields in your Laravel application towards the Moneybird accounting software.
Installation
You can install the package via composer:
composer require janyksteenbeek/laravel-moneybird-sync
You can publish the config file with:
php artisan vendor:publish --tag="moneybird-sync-config"
Set all the required values in the config file or in your environment variables. See section "Setup" for more information.
Next, add the trait to your User model:
use Janyk\LaravelMoneybirdSync\Traits\IsMoneybirdContact; class User extends Authenticatable { use IsMoneybirdContact; }
Setup instructions
- Follow the installation instructions to include the package in your application.
- Before you can use this package, you need to register your application with Moneybird. Registration is a one-time event for the developer and can be done here. Make sure you register an application for personal use.
- After registering your application, you will receive an access token. This token is used to authenticate your application with Moneybird. Set this token in your environment variables as
MONEYBIRD_TOKEN
. - Navigate back to your application page and copy the
Client ID
andClient secret
to your environment variables asMONEYBIRD_CLIENT_ID
andMONEYBIRD_CLIENT_SECRET
. MONEYBIRD_ADMINISTRATION_ID
is the ID of the administration you want to sync with. You can find this ID in the URL of your Moneybird administration. For example, if the URL of your administration ishttps://moneybird.com/123456789/sales_invoices
, the ID is123456789
. Be sure to set this ID in your environment variables.- Make sure you have a
User
model in your application. This model should have amoneybird_id
column. This column will be used to store the Moneybird ID of the contact. - Make sure the other fields you want to sync with Moneybird are present on your
User
model. You can change these mapping of those fields in the config file. - Add the
IsMoneybirdContact
trait to yourUser
model.
Security Vulnerabilities
If you are an outside collaborator and discover a security vulnerability within this repository, please send an e-mail to our security team via security-external@webmethod.nl. Do not use GitHub Issues to report security vulnerabilities. All security vulnerabilities will be promptly addressed. Please adhere to the Webmethod Coordinated Vulnerability Disclosure guidelines at all times.
Credits
License
The MIT License (MIT). Please see License File for more information.
Disclaimer
This package is not affiliated with or endorsed by Moneybird B.V. or any of its affiliates. The use of the trademark Moneybird is solely for the purpose of identifying the company and its products. Moneybird is a registered trademark of Moneybird B.V. and all rights pertaining to the trademark are the exclusive property of the trademark owner. Any references to Moneybird are made strictly for identification purposes and do not imply any endorsement or sponsorship by Moneybird B.V.