tomlankhorst/laravel-afas

Laravel package around tomlankhorst/afas-profit

1.2.0 2019-10-26 07:37 UTC

This package is auto-updated.

Last update: 2024-10-26 19:16:18 UTC


README

Build Status Latest Stable Version License Total Downloads

A module that integrates tomlankhorst/afas-profit with Laravel.

Requirements

  • PHP 7.2 +
  • Laravel 5.5, 5.7, 5.8 (5.6 is EOL)

Configuration

composer require tomlankhorst/laravel-afas ^1.0

Add an afas.php configuration file.

<?php

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

Usage

As a facade

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

Credits

Thanks to iPublications for developing iPublications/AFAS-ProfitClass-PHP.