tomlankhorst/laravel-afas

Laravel 包,围绕 tomlankhorst/afas-profit

1.2.0 2019-10-26 07:37 UTC

This package is auto-updated.

Last update: 2024-09-26 19:04:37 UTC


README

Build Status Latest Stable Version License Total Downloads

一个将 tomlankhorst/afas-profit 集成到 Laravel 的模块。

要求

  • PHP 7.2+
  • Laravel 5.5, 5.7, 5.8 (5.6 已停止支持)

配置

composer require tomlankhorst/laravel-afas ^1.0

添加一个 afas.php 配置文件。

<?php

return [
    'connections' => [
        'default' => [
            'location' => env('AFAS_LOCATION'),
            'connectors' => [
                'products' => [
                    'id' => env('AFAS_PRODUCTS_CONNECTOR'),
                    'environment' => env('AFAS_ENVIRONMENT'),
                    'token' => env('AFAS_TOKEN'),
                ],
            ]
        ],
    ],
];

用法

作为外观

$results = Afas::connector('products')
    ->where('sku', 'LIKE', 'XY%')
    ->orWhere('sku', 'LIKE', 'XXY%')
    ->take(10)
    ->skip(10)
    ->get();

致谢

感谢 iPublications 开发 iPublications/AFAS-ProfitClass-PHP