Download the PHP package lukapeharda/kourses-php without Composer

On this page you can find all versions of the php package lukapeharda/kourses-php. 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 kourses-php

Kourses PHP bindings

The Kourses PHP library provides access to Kourses API from applications written in PHP. It includes a pre-defined set of classes for API resources such as members, memberships and permissions.

Requirements

PHP 5.6.0 and later.

Installation

You can install the library via Composer. Run the following command:

To use the library, use Composer's autoload:

Getting Started

Visit Kourses Settings / API keys page and generate API key. Each key is tied to only one of your website. Copy your API key as you won't be able to access the token later on.

API key should go in HTTP Authorization header as a bearer token:

First initialize a client and set the token

If you want to access beta environment of Kourses app, use setApiBaseUrl method to change the URL:

Fetching memberships

To fetch all published memberships use memberships resource and the all method:

Returned data will be paginated (default number of memberships per page is 100). In order to change number of memberships per page or current page use page and per_page params (respectively):

You can iterate over $memberships to get KoursesPhp\Membership entities.

There are several helpful methods to handle pagination:

Creating members

Use create method on the members resource:

If member was found (based on their email address) they will be updated with the rest of the given data.

You may set a list of memberships for which the member should get access to in the same API call:

Sending activation email

By default, when new member is created they will be sent an activation email.

To disable this set send_activation_notification to 0:

Setting permission expiry dates

For each membership you can set future expiry date using memberships_ends_at param or nested memberships[0][ends_at]. Date given needs to be in YYYY-MM-DD or YYYY-MM-DD hh:mm:ss format:

Skipping drip schedule

For each membership you can disable drip schedule using memberships_skip_drip_schedule param or nested memberships[0][skip_drip_schedule]:

By default it will honor the set drip schedule.

Running membership's email integrations

For each membership you can enable running of email integrations using memberships_run_email_integrations param (or nested memberships[0][run_email_integrations]):

Fetching allowed memberships for a member

Use memberMemberships resource and all method to fetch a list of all memberships that member was granted access to:

You can even use member's email address to fetch the memberships:

Returned data will be paginated (default number of memberships per page is 100). In order to change number of memberships per page or current page use page and per_page params (respectively):

Generate one-click login link for a member

Use memberLoginLink resource and its create method to generate temporary signed login link.

Returned $loginLink object will have a login_link property which you can serve to your user in order for them to log in. expires_at property which holds the timestamp (ISO-8601) then the login link will expire.

Signed link will expired in 5 mins (300 seconds).

You can even use member's email address to generate the link:

If you wish to redirect the member after successful login specify a redirect param with relative path:

Grant a permission

To grant a permission you need to call create method on permissions resource and provide a member ID (or their email address) and a membership ID:

You can add and extra ends_at param to specify permission expiry date. Date given needs to be in YYYY-MM-DD or YYYY-MM-DD hh:mm:ss format:

If you wish to skip drip schedule set for a given membership use skip_drip_schedule and set it to 0:

If you wish to run email integrations for a given membership use run_email_intgrations and set it to 1:

By default the set drip schedule will be honored.

Revoke a permission

To revoke a permission you need to call delete method on permissions resource and provide a member ID (or their email address) and a membership ID:

You can add and extra ends_at param to specify permission expiry date. Date given needs to be in YYYY-MM-DD or YYYY-MM-DD hh:mm:ss format:

Documentation

Check out examples folder for some basic use cases. Full documentation is available on developer.kourses.com.


All versions of kourses-php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
guzzlehttp/guzzle Version 6.3.*|6.5.*|^7.2
illuminate/support Version ~5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
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 lukapeharda/kourses-php contains the following files

Loading the files please wait ....