dystcz/laravel-fakturoid 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dystcz/laravel-fakturoid

最新稳定版本:3.1.0

Composer 安装命令:

composer require dystcz/laravel-fakturoid

包简介

Laravel wrapper for Fakturoid

README 文档

README

Latest Version on Packagist Total Downloads Tests

Simple wrapper for official php package https://github.com/fakturoid/fakturoid-php

Docs

Installation

Step 1: Install package

Add the package in your composer.json by executing the command.

composer require dystcz/fakturoid

This will both update composer.json and install the package into the vendor/ directory.

Step 2: Configuration

First initialise the config file by running this command:

php artisan vendor:publish

With this command, initialize the configuration and modify the created file, located under config/fakturoid.php.

Configuration

return [
    'client_id' => env('FAKTUROID_CLIENT_ID', 'XXX'),
    'client_secret' => env('FAKTUROID_CLIENT_SECRET', 'XXX'),
    'account_slug' => env('FAKTUROID_ACCOUNT_SLUG'),
    'user_agent' => env('FAKTUROID_USER_AGENT', 'Application <your@email.cz>'),
];

Examples

Create Subject, Create Invoice, Send Invoice

use Dystcz\Fakturoid\Facades\Fakturoid;

try {
    // create subject
    $response = Fakturoid::getSubjectsProvider()->create([
        'name' => 'Firma s.r.o.',
        'email' => 'aloha@pokus.cz'
    ]);

    if ($subject = $response->getBody()) {
        // Create invoice with lines
        $lines = [
            [
                'name' => 'Big sale',
                'quantity' => 1,
                'unit_price' => 1000
            ],
        ];

        $invoiceProvider = Fakturoid::getInvoicesProvider();

        $response = Fakturoid::getInvoicesProvider()->create([
            'subject_id' => $subject->id,
            'lines' => $lines
        ]);

        $invoice = $response->getBody();

        // Send created invoice
        $invoiceProvider->fireAction($invoice->id, 'deliver');
    }
} catch (\Exception $e) {
    dd($e->getCode() . ": " . $e->getMessage());
}

More examples

For more examples, please visit the Fakturoid documentation.

Credits

License

Copyright (c) 2019 - 2025 dyst digital s.r.o MIT Licensed.

统计信息

  • 总下载量: 393
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-11-30