Skip to content

Commit 4e69892

Browse files
committed
Update for Laravel 6.0
1 parent bbc47e6 commit 4e69892

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

composer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,13 @@
4242
"php": ">=7.2",
4343
"illuminate/console": "^6.0",
4444
"illuminate/database": "^6.0",
45-
"illuminate/filesystem": "^6.0"
45+
"illuminate/filesystem": "^6.0",
46+
"laravel/helpers": "^1.1"
4647
},
4748
"require-dev": {
4849
"phpunit/phpunit": "^8.0",
4950
"mockery/mockery": "^1.0",
50-
"orchestra/testbench": "^3.8"
51+
"orchestra/testbench": "^4.0"
5152
},
5253
"autoload": {
5354
"psr-4": {
@@ -71,5 +72,7 @@
7172
"OwenIt\\Auditing\\AuditingServiceProvider"
7273
]
7374
}
74-
}
75+
},
76+
"minimum-stability": "dev",
77+
"prefer-stable": true
7578
}

src/Audit.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
namespace OwenIt\Auditing;
44

55
use DateTimeInterface;
6-
use Illuminate\Database\Eloquent\Model;
6+
use Illuminate\Support\Str;
77
use Illuminate\Support\Facades\Config;
8+
use Illuminate\Database\Eloquent\Model;
89
use OwenIt\Auditing\Contracts\AttributeEncoder;
910

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

148149
// User value
149-
if ($this->user && starts_with($key, 'user_')) {
150+
if ($this->user && Str::startsWith($key, 'user_')) {
150151
return $this->getFormattedValue($this->user, substr($key, 5), $value);
151152
}
152153

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

157158
return $this->getFormattedValue(

0 commit comments

Comments
 (0)