Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

Commit

Permalink
Fixed issues with different Nova versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Vyacheslav Basenko committed Nov 17, 2019
1 parent 9589a7f commit 4b918f5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Froala.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions tests/FroalaUploadControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions tests/TrixDriverUploadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 4b918f5

Please sign in to comment.