Download the PHP
package ethical-jobs/sdk-php without Composer
On this page you can find all versions of the php package
ethical-jobs/sdk-php. It is possible to download/install
these versions without Composer. Possible dependencies are resolved
automatically.
Vendor ethical-jobs Package sdk-php Short Description EthicalJobs API client and SDK License
MIT
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.
All current EJ packages will be taken offline by mid-2021 in order to re-released under a single package.
Compatibility
v8.* - Laravel 8 or higher, PHP >8.x,<9.x
v4.* - Laravel 8 or higher, PHP 7.3
v3.* - Laravel 7 or lower (possibly only 5.6 to 5.9)
Installation
composer require ethical-jobs/@ethical-jobs/sdk
For Laravel < 5.5.x include the service provider and facade in you config/app.php file EthicalJobs\SDK\Laravel\ServiceProvider::class, 'EthicalJobs' => EthicalJobs\SDK\Laravel\ApiFacade::class,. For Laravel >= 5.5.x the package will auto-include the service provider and facade.
Authentication
You will need to set 4 environment variables to enable authentication:
When using an endpoint that requires authentication you first need to call EthicalJobs::authenticate().
Making Requests
There are many ways to access api resources, following are some examples:
Responses
Responses are returned as EthicalJobs\SDK\Collection that extends Illuminate\Support\Collection. If there are no results an empty collection is returned. This class has extended methods for selecting nested response items: $collection->entities('jobs');. Also there are
Testing and mocking
For easy mocking of SDK responses there exists a response stack helper function on the ApiClient or EthicalJobs facade. This returns a fully mocked instance of the ApiClient that you may inject into the Laravel IOC container or use directly.
For mocking actual SDK responses there are also up-to-date mock JSON responses accessible within EthicalJobs\SDK\Testing\ResponseFactory.
Requiresphp Version
~8.0 ext-json Version
* guzzlehttp/guzzle Version
^7.4
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 ethical-jobs/sdk-php contains the following files
Loading the files please wait ....
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.