PHPackages                             szunisoft/laravel-unas - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. szunisoft/laravel-unas

ActiveLibrary[API Development](/categories/api)

szunisoft/laravel-unas
======================

Laravel package for UNAS Webshop API

v1.0.15(6y ago)1133MITPHPPHP &gt;=7.2CI failing

Since Jun 14Pushed 6y ago1 watchersCompare

[ Source](https://github.com/SzuniSOFT/laravel-unas)[ Packagist](https://packagist.org/packages/szunisoft/laravel-unas)[ RSS](/packages/szunisoft-laravel-unas/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (9)Versions (17)Used By (0)

[![Build Status](https://camo.githubusercontent.com/9d03a5464b4c1cb18157b7ecc12179887ddfcce725a4201e160c432f6ccf1c5c/68747470733a2f2f7472617669732d63692e6f72672f537a756e69534f46542f6c61726176656c2d756e61732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/SzuniSOFT/laravel-unas)[![Latest Stable Version](https://camo.githubusercontent.com/d69ac7d4559f67811ff8300e3bb0a4e680193f4f33d5a664ace172e7f97e8953/68747470733a2f2f706f7365722e707567782e6f72672f737a756e69736f66742f6c61726176656c2d756e61732f76657273696f6e)](https://packagist.org/packages/szunisoft/laravel-unas)[![Total Downloads](https://camo.githubusercontent.com/ee4b1821d9b6eb5ec44af8f94da4313c1d71b3a1fe2f315932cc71dcb22a37dd/68747470733a2f2f706f7365722e707567782e6f72672f737a756e69736f66742f6c61726176656c2d756e61732f646f776e6c6f616473)](https://packagist.org/packages/szunisoft/laravel-unas)[![License](https://camo.githubusercontent.com/a9e3590c9444d3bd9f167bcafdfd99a09dc7f003a69eb8c4a099869173497044/68747470733a2f2f706f7365722e707567782e6f72672f737a756e69736f66742f6c61726176656c2d756e61732f6c6963656e7365)](https://packagist.org/packages/szunisoft/laravel-unas)[![PHP from Packagist](https://camo.githubusercontent.com/71a1e00980825bc3b216cceb4cc623a9e3e9404211e4ebc0066bcf7b60784699/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f737a756e69736f66742f6c61726176656c2d756e61732e7376673f6c6162656c3d70687025323076657273696f6e267374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/71a1e00980825bc3b216cceb4cc623a9e3e9404211e4ebc0066bcf7b60784699/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f737a756e69736f66742f6c61726176656c2d756e61732e7376673f6c6162656c3d70687025323076657273696f6e267374796c653d666c61742d737175617265)[![Coverage Status](https://camo.githubusercontent.com/a54404ab0a0d9291725326642f75f460b226d9d5261624eac91df58aa8d7099e/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f537a756e69534f46542f6c61726176656c2d756e61732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/SzuniSOFT/laravel-unas?branch=master)

Laravel Unas
============

[](#laravel-unas)

*About the package*

The package is not finished yet however will be maintained and developed continuously as our primary project which requires this extension will.

*Naming conventions*

At some point the official Unas naming convention is not that good or does not exist at all. However the package is not trying to introduce custom naming conventions it will use the official property and attribute names as they are described in the [documentation](https://shop.unas.hu/apidoc).

API compatibility
-----------------

[](#api-compatibility)

The following table contains the related API endpoints. All the endpoints will be supported soon.

EndpointSupportgetProduct✔️setProduct❌getOrder❌setOrder❌getStock❌setStock❌getCategory❌setCategory❌getNewsletter❌setNewsletter❌Future features ⭐
-----------------

[](#future-features-star)

##### Configurable Rate Limiting

[](#configurable-rate-limiting)

Will fire an event each time an endpoint is being exhausted based on the given configuration.

Requirements ❗
--------------

[](#requirements-exclamation)

- php &gt;= 7.2
- ext-xmlwriter
- ext-simplexml

Install ▶️
----------

[](#install-arrow_forward)

```
composer require szunisoft/laravel-unas

```

Laravel support ✋
-----------------

[](#laravel-support-hand)

`>= 5.5`

Configure ⚙️
------------

[](#configure-gear)

Export the configuration

```
php artisan vendor:publish --provider="SzuniSoft/Unas/Laravel/UnasServiceProvider" --tag=config

```

##### Authentication

[](#authentication)

Two authentication drivers are supported.

###### Legacy (default driver)

[](#legacy-default-driver)

*You must set the driver to **legacy**.*

For legacy authentication you will need the following credentials:

- username
- password
- shop\_id
- auth\_code

###### Key

[](#key)

*You must set the driver to **key**.*

In case of key authentication you will need to generate an API key inside the Unas portal.

##### Error handling principles

[](#error-handling-principles)

Some kind of exceptions can be turned into events rather than throwing them. This is just a code architectural decision how a particular circumstance should be handled.

For instance we create a multi-tenancy project which will handle tons of different clients traffic behind the scenes. It is more wise to consume and intercept errors as events since we'll be able to use multiple listeners on it and we can send notification to the tenant also.

In the other hand if you'll need a very specific and custom application for a single tenant then it would be more appropriate to intercept errors as exceptions because it is probably the core component of the entire application.

*By default all events are disabled and going to raise.*

To adjust your needs your can freely add or remove events declared in the configuration file.

```
