Download the PHP package websmurf/laravel-exact-online without Composer

On this page you can find all versions of the php package websmurf/laravel-exact-online. 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 laravel-exact-online

Laravel Exact Online

This package is a Laravel wrapper around the Exact Online PHP API by Picqer (https://github.com/picqer/exact-php-client). It provides routes and a controller out of the box to connect your Laravel app with an Exact Online app. It also provides a Facade which is chainable to make requests to the API easily. Authorisation and refresh tokens are saved automatically.

Note: the tokens are saved in a json file for application wide use. Therefor this code is not suitable if your platform need access to Exact Online for a single user! This set of code may be used to communicate with a single Exact Online user's administration.

Installation

Require the package

Because of the auto package discovery feature Laravel > 5.5 has, the ServiceProvider and Facades are automatically registered.

Add the Facade to your config/app.php

Followed by this, publish the resources (views, config, etc.)

While developing this package, you might want to use the --force flag on this command to overwrite previous files.

And last but not least either edit config/laravel-exact-online to match your Exact Online app settings or add these keys to your .env:

The following keys are optional

Multiuser support

Out of the box this plugin stores the exact keys inside a JSON file. This means every user uses the same credentials. If you would like to give your users the opportunity to make individual connections you can do so by setting the following parameter inside your .env file:

Sidenote: There's no migration written for this feature yet. Feel free to do so. In the meantime you should add these changes to your user migration:

and add these fillables to your user object:

How to use connect Laravel & Exact Online

As said this package provides the route and controller to easily connect your Exact App with your Laravel project. You may overwrite the routes in you routes/web.php file, I even insist on doing so because the routes are not protected by default!

You may also edit the views to your liking, after publishing they can be found under /views/vendor/laravel-exact-online/ in your resources path.

Step 1: connect & authorise

Visit http://your-project.local/exact/connect, you will be presented a submit button to go to Exact Online. Once there, login and approve the app. After this you will be returned do http://your-project.local/exact/oauth, this route takes care of saving the needed tokens for future requests.

Step 2: use the Facade

That's it, you're now ready to use the package.

How to use the API

The package by Picqer requires you to provide a valid connection parameter to each resource you are about to use. This is done by a big piece of code which requires adding tokens. In the ServiceProvider of this package we've made a singleton that does all this for you:

This connection then is used when requesting resources using Picqer's classes:

Using Dependency Injection, you can request an instance that already creates connection instance for you:

Or if you prefer using the Facade, you can do that as well:

All methods that change the connection are camelCased and prefixed with connection, for example if you want to change the baseUrl of the API you would call:

Of course everything is chainable for readability:

Credits

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-exact-online with dependencies

PHP Build Version
Package Version
Requires picqer/exact-php-client Version ^3.1
ext-json Version *
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 websmurf/laravel-exact-online contains the following files

Loading the files please wait ....