Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
php-version: '8.4'
coverage: none

- name: Install composer dependencies
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.3, 8.4]
laravel: [11.*, 12.*]
php: [8.4, 8.5]
laravel: [12.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 11.*
testbench: 9.*
carbon: ^2.63
- laravel: 12.*
testbench: 10.*
carbon: ^3.0
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"homepage": "https://github.com/LycheeOrg/verify",
"license": "MIT",
"require": {
"php": "^8.3",
"php": "^8.4",
"illuminate/contracts": "^12.0||^11.0",
"thecodingmachine/safe": "^3.3"
},
Expand Down Expand Up @@ -47,7 +47,7 @@
},
"config": {
"platform": {
"php": "8.3"
"php": "8.4"
},
"sort-packages": true,
"allow-plugins": {
Expand Down
2 changes: 1 addition & 1 deletion config/verify.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
ValidateSupporter::class => 'ef1a42701af6dc36e052556a0ee1c762394f9428',
ValidatePro::class => '482b48f1a026684b6c1754e45ca180ffc52483ff',
ValidateSignature::class => '5a8a855d4b59c44c298daa66801c79f2aba20492',
Verify::class => 'f15a25c69847bf635c7b0cc730ea24a5aaf008b8',
Verify::class => '421e83a049b1df58c73b546adb132a082075fd2c',
VerifySupporterStatus::class => '6358c45ed0414c1e2697e0881238659fa6221bed',
VerifyProStatus::class => '212e6ada794587ee8e2b81cf76e243d134a7e823',
VerifyServiceProvider::class => '923b63b15d25e69b95ed1d5ec1c82ba57f1a7d74',
Expand Down
22 changes: 22 additions & 0 deletions src/Verify.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class Verify implements VerifyInterface
private ValidateSupporter $validateSupporter;
private ValidatePro $validatePro;

private ?Status $status;

public function __construct(
#[\SensitiveParameter] ?string $config_email = null,
#[\SensitiveParameter] ?string $license_key = null,
Expand All @@ -41,6 +43,16 @@ public function __construct(
* @return Status
*/
public function get_status(): Status
{
return $this->status ??= $this->resolve_status();
}

/**
* Private resolver for status.
*
* @return Status
*/
private function resolve_status(): Status
{
$base = json_encode(['url' => config('app.url'), 'email' => $this->config_email]);

Expand All @@ -59,6 +71,16 @@ public function get_status(): Status
return Status::FREE_EDITION;
}

/**
* Reset the cached status.
*
* @return void
*/
public function reset_status(): void
{
$this->status = null;
}

/**
* Validate installation.
*
Expand Down