1. Go to this page and download the library: Download helpscout/api-laravel library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use HelpScout\Api\ApiClient;
use HelpScout\Api\Entity\PagedCollection;
class Foo
{
private $api;
public function __construct(ApiClient $api)
{
$this->api = $api;
}
public function getWebhooks(): PagedCollection
{
return $this->api->webhooks()->list();
}
}
use HelpScout\Api\Webhooks\WebhooksEndpoint;
use HelpScout\Api\Entity\PagedCollection;
class Foo
{
private $endpoint;
public function __construct(WebhooksEndpoint $endpoint)
{
$this->endpoint = $endpoint;
}
public function getHsWebhooks(): PagedCollection
{
return $this->endpoint->list();
}
}
// usage
$foo = app(Foo::class);
$webhooks = $foo->getHsWebhooks();
// using the endpoints registered alias...
$webhookEndpoint = app('hs.webhooks');
$webhooks = $webhookEndpoint->list();
$webhooks = HelpScout::webhooks()->list();
sh
php composer.phar update
sh
php artisan vendor:publish --provider="HelpScout\Laravel\HelpScoutServiceProvider"
// or
php artisan vendor:publish --tag="helpscout"
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.