mirror of
https://github.com/koel/koel
synced 2024-12-23 02:53:20 +00:00
35 lines
737 B
PHP
35 lines
737 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Integrations\LemonSqueezy\Requests;
|
||
|
|
||
|
use App\Models\License;
|
||
|
use Saloon\Contracts\Body\HasBody;
|
||
|
use Saloon\Enums\Method;
|
||
|
use Saloon\Http\Request;
|
||
|
use Saloon\Traits\Body\HasFormBody;
|
||
|
|
||
|
class ValidateLicenseRequest extends Request implements HasBody
|
||
|
{
|
||
|
use HasFormBody;
|
||
|
|
||
|
protected Method $method = Method::POST;
|
||
|
|
||
|
public function __construct(private License $license)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
public function resolveEndpoint(): string
|
||
|
{
|
||
|
return '/licenses/validate';
|
||
|
}
|
||
|
|
||
|
/** @return array<mixed> */
|
||
|
protected function defaultBody(): array
|
||
|
{
|
||
|
return [
|
||
|
'license_key' => $this->license->key,
|
||
|
'instance_id' => $this->license->instance->id,
|
||
|
];
|
||
|
}
|
||
|
}
|