diff --git a/src/Froala.php b/src/Froala.php index 643b4e1..52ac169 100644 --- a/src/Froala.php +++ b/src/Froala.php @@ -107,7 +107,7 @@ public function withFiles($disk = null, $path = '/') { $this->withFiles = true; - if (nova_version_higher_then('2.7.0')) { + if (nova_version_at_least('2.7.0')) { $this->disk($disk)->path($path); } else { $this->disk($disk); diff --git a/src/helpers.php b/src/helpers.php index 3b1726d..4b956aa 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -4,7 +4,7 @@ use Laravel\Nova\Nova; -function nova_version_higher_then(string $version) +function nova_version_at_least(string $version) { - return version_compare(Nova::version(), $version) === 1; + return version_compare(Nova::version(), $version) >= 0; } diff --git a/tests/FroalaUploadControllerTest.php b/tests/FroalaUploadControllerTest.php index 9905a9e..bc3a3d5 100644 --- a/tests/FroalaUploadControllerTest.php +++ b/tests/FroalaUploadControllerTest.php @@ -4,7 +4,7 @@ use Froala\NovaFroalaField\Models\Attachment; use Froala\NovaFroalaField\Models\PendingAttachment; -use function Froala\NovaFroalaField\nova_version_higher_then; +use function Froala\NovaFroalaField\nova_version_at_least; use Froala\NovaFroalaField\Tests\Fixtures\Article; use Illuminate\Support\Facades\Storage; use Laravel\Nova\Nova; @@ -40,7 +40,7 @@ public function store_attachment() $response = $this->storeArticle(); - if (nova_version_higher_then('1.3.1')) { + if (nova_version_at_least('1.3.1')) { $response->assertJson([ 'resource' => [ 'title' => 'Some title', diff --git a/tests/TrixDriverUploadTest.php b/tests/TrixDriverUploadTest.php index 94eb81b..f516488 100644 --- a/tests/TrixDriverUploadTest.php +++ b/tests/TrixDriverUploadTest.php @@ -2,7 +2,7 @@ namespace Froala\NovaFroalaField\Tests; -use function Froala\NovaFroalaField\nova_version_higher_then; +use function Froala\NovaFroalaField\nova_version_at_least; use Froala\NovaFroalaField\Tests\Fixtures\Article; use Froala\NovaFroalaField\Tests\Fixtures\TestServiceProvider; use Illuminate\Support\Facades\Schema; @@ -61,7 +61,7 @@ public function store_attachment() $response = $this->storeArticle(); - if (nova_version_higher_then('1.3.1')) { + if (nova_version_at_least('1.3.1')) { $response->assertJson([ 'resource' => [ 'title' => 'Some title',