Download the PHP package faaren-tech/faaren-sdk without Composer

On this page you can find all versions of the php package faaren-tech/faaren-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package faaren-sdk

FAAREN SDK

Installation

Customize the service_url parameter in config auth-sdk.php or set the value FAAREN_AUTH_SERVICE_URL in your .env file.

Usage

Important! If you use this library in a docker context FAAREN_AUTH_SERVICE_URL has to be the IP address of your machine. Otherwise it will try to find a host in its own docker network. As an alternative you can add an external_hosts option to your docker-compose-container.

You can use the package everywhere by simply initializing it:

The Token-Object contains the following details, for example:

The listed permissions, subsidiary_uuid and user_uuid can be used to make your app-specific authorization.

Notifications

Mailings

You can simply trigger notifications via the Notification Service:

If an error occurs while calling the Notification Service, a \FaarenTech\FaarenSDK\Exceptions\NotificationServiceException is thrown. The exception message will contain a hint what was going wrong, e.g. an validation error:

"message": "Status 422: Notification could not be sent because: The to field is required.",

The used tokens and endpoints can be customized via you .env file. The available keys are listed in /config/faaren-sdk.php within the vendor directory or, if you have published the config, in your applications config-folder.

Middlewares

AcceptsJsonMiddleware

HasValidTokenMiddleware

You can add the middleware group faaren to all routes you like. This middleware group contains the following middlewares:

Using this middleware makes it easy to work with tokens. You can access the token details everywhere via the request object:

Form Requests

This package provides a BaseRequest, the FaarenRequest. This Request implementes the Illuminate\Contracts\Auth\Access\Authorizable via the Illuminate\Foundation\Auth\Access\Authorizable trait. It can be used for any FormRequest you will create in your service.

This way it is possible to authorize incoming requests directly in your form request:

In your policy you won't pass in an instance of your User. Instead you pass in an instance of your form request. The underlying policy:

Define Resources

Since version 1.1.0 we use "ResponseCollection" and "ResourceCollection" in our Resource-definitions.

To use your own Resource with our Schema, you need to extend your Resource from "ResponseResource" and not from "JsonResource" Then you need to change your "toArray" method to "toPayload" Example:

Resource Collection:

So your Resource gets mapped as YourAwesomeResourceCollection

Validation as Json in our Response-Schema

Your class needs to be extend from "FaarenRequest", and every validation error uses the schema

Handle Exceptions as Json

Simple add the AcceptsJsonMiddleware to the relevant middleware groups or as a global middleware.

Using the custom Handler is deprecated and will cause errors when you use it!


All versions of faaren-sdk with dependencies

PHP Build Version
Package Version
Requires phpunit/phpunit Version ^9.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package faaren-tech/faaren-sdk contains the following files

Loading the files please wait ...