tomlankhorst/laravel-afas

Laravel package around tomlankhorst/afas-profit


Keywords
afas, api, finance, laravel, php
License
MIT

Documentation

Laravel Afas

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.