Download the PHP package bluelightco/lever-php without Composer

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

Lever PHP

Latest Version on Packagist Total Downloads

Super-simple Lever Data API v1 wrapper in PHP with support for Laravel.

Installation

You can install the package via composer:

Usage

PHP

Laravel

After installing, the package will automatically register its service provider.

To publish the config file to config/lever-php.php run:

After changing your API keys in your ENV file accordingly, you can call a Lever instance as follows:

Methods

This package is modeled after Lever's Data API documentation, so you should be able to find a method for many of the endpoints.

For example, if you would like to fetch all Opportunities you would simply call:

To retrieve a single opportunity you should call the same method while passing the id as a parameter:

To create an opportunity use the create method while passing the fields array (use same names as Lever):

When submiting an application on behalf of a candidate to a specific posting you should use the following method:

When an update endpoint is available, you can do it as follows:

Be aware of the resources that require some parameters to work. When creating a posting for example, the _performas parameter is required. You can pass this information with the performAs($userId) method.

When a resource depends on another one to work, you can simply chain the methods (order is important). For example, to retrieve the offers of a opportunity, you should execute this:

When Lever asks to use the PUT verb, you can use putUpdate() instead of update() (POST).

Parameters

There are many helper methods available to include parameters in a request. For example, to include the followers and expand applications and stages, when fetching opportunities, you can do so:

Notice you can pass a string or an array of strings in both methods, and you can chain the same method many times if you wish.

Not all parameters have a method available, but you can use the addParameter($field, $value) method for this. This method can be chained without overwriting previous values. For example:

Be aware that when using the same field name, the new value will be appended and not overwritten.

Uploading files and resumes

LeverPhp allows you to include resumes or files when available. To do this, you have to include the file in the fields array (see example) and chaining the hasFiles() method (before the create or update method!). For example, you can append a resume when creating an opportunity:

Currently, there is no support for multiple files in one call.

Pagination

All Lever resources with a list endpoint (candidates, users, postings) have pagination and a max limit of 100 results per page. LeverPhp handles this automatically leveraging Laravel LazyCollection class. For example, you can iterate over the whole set of Opportunities without worrying about pagination:

When item hundred is reached, another call is made to the API requesting the next 100 items until there are no more left.

Of course you can take advantage of all methods available on the LazyCollection class.

Rate Limit and Exponential Backoff

By default, Lever API allows a steady state number of 10 requests/second per API key.

To comply with this, LeverPhp automatically limits the number of requests to the Lever Data API to 10 per second and uses exponential backoff to decrease the retry rate when a 429 or 500 response is received. Please plan you code accordingly, as a request might take much longer than expected because of this. Using some kind of queues is suggested.

By default, the rate limiter works in memory. This means that if you have a second PHP process (or Guzzle client) consuming the same API, you'd still possibly hit the rate limit.

The LeverPhp() constructor accepts a custom store in its third parameter to overcome the in memory issue. If you are using Laravel, a custom store that uses your cache driver is already configured. Please see the documentation of GuzzleRateLimiterMiddleware if you need more information.

Client

If a method is not available for the resource you are trying to reach, you can get an instance of the Guzzle client directly by calling Lever::client(). Feel free to add it to the source code. Please see CONTRIBUTING for details.

Testing

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

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

Credits

License

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


All versions of lever-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
graham-campbell/guzzle-factory Version ^7.0
guzzlehttp/guzzle Version ^7.8
illuminate/support Version *
spatie/guzzle-rate-limiter-middleware Version ^2.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 bluelightco/lever-php contains the following files

Loading the files please wait ....