casdr/laravel-moneybird

基于Picq'ers客户端的Laravel Moneybird包

v1.1.0 2018-08-14 21:45 UTC

This package is not auto-updated.

Last update: 2024-09-29 02:27:07 UTC


README

Latest Version on Packagist Software License Total Downloads

此Laravel包是picqer/moneybird-php-client的包装器。

安装

通过Composer

$ composer require casdr/laravel-moneybird

Laravel使用包自动发现,因此不需要您手动添加ServiceProvider。

无自动发现模式的Laravel

如果您不使用自动发现,请将ServiceProvider和Facade添加到您的config/app.php

'providers' => [
  ...
  Casdr\Moneybird\MoneybirdServiceProvider::class,
],
'aliases' => [
  ...
  'Moneybird' => Casdr\Moneybird\MoneybirdFacade::class,
]

然后运行以下命令将配置发布到您的config/目录。

$ php artisan vendor:publish --tag=config

然后您需要在Moneybird界面中生成一个应用程序,并设置此模块的配置。

return [
    'redirect_uri' => 'urn:ietf:wg:oauth:2.0:oob',
    'client_id' => 'ij8uhui34g1409fn', // The client ID of your Moneybird application
    'client_secret' => 'hu4ht89y0rfhbsduofas', // The client secret of your Moneybird application
    'authorization_token' => '', // The authorization token for your account (https://developer.moneybird.com/authentication/#authentication) (optional)
    'access_token' => '', // The access token for your account  (optional)
    'administration_id' => '' // The administration ID you want to use (optional)
];

用法

$contact = Moneybird::contact();

$contact->company_name = 'BlaLabs';
$contact->firstname = 'Cas';
$contact->lastname = 'de Reuver';
$contact->save();

有关更多使用信息,请参阅picqer/moneybird-php-client

致谢

许可证

MIT许可证(MIT)。有关更多信息,请参阅许可证文件