Skip to content

Commit

Permalink
Merge pull request #545 from divdax/laravel-6
Browse files Browse the repository at this point in the history
Laravel 6
  • Loading branch information
anteriovieira authored Sep 11, 2019
2 parents eb17c7b + 9081b20 commit df09089
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 23 deletions.
12 changes: 0 additions & 12 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,6 @@ filter:

build:
nodes:
php71:
environment:
php:
version: 7.1.3
tests:
override:
- php-scrutinizer-run
-
command: vendor/bin/phpunit --coverage-clover=coverage71
coverage:
file: coverage71
format: php-clover
php72:
environment:
php:
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ env:
language: php

php:
- 7.1
- 7.2

before_script:
Expand Down
17 changes: 10 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,16 @@
}
],
"require": {
"php": ">=7.1.3",
"illuminate/console": "^5.8",
"illuminate/database": "^5.8",
"illuminate/filesystem": "^5.8"
"php": ">=7.2",
"illuminate/console": "^6.0",
"illuminate/database": "^6.0",
"illuminate/filesystem": "^6.0",
"laravel/helpers": "^1.1"
},
"require-dev": {
"phpunit/phpunit": "^7.5",
"phpunit/phpunit": "^8.0",
"mockery/mockery": "^1.0",
"orchestra/testbench": "^3.8"
"orchestra/testbench": "^4.0"
},
"autoload": {
"psr-4": {
Expand All @@ -71,5 +72,7 @@
"OwenIt\\Auditing\\AuditingServiceProvider"
]
}
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
7 changes: 4 additions & 3 deletions src/Audit.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace OwenIt\Auditing;

use DateTimeInterface;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\Config;
use Illuminate\Database\Eloquent\Model;
use OwenIt\Auditing\Contracts\AttributeEncoder;

trait Audit
Expand Down Expand Up @@ -146,12 +147,12 @@ public function getDataValue(string $key)
$value = $this->data[$key];

// User value
if ($this->user && starts_with($key, 'user_')) {
if ($this->user && Str::startsWith($key, 'user_')) {
return $this->getFormattedValue($this->user, substr($key, 5), $value);
}

// Auditable value
if ($this->auditable && starts_with($key, ['new_', 'old_'])) {
if ($this->auditable && Str::startsWith($key, ['new_', 'old_'])) {
$attribute = substr($key, 4);

return $this->getFormattedValue(
Expand Down

0 comments on commit df09089

Please sign in to comment.