Skip to content

Commit df09089

Browse files
Merge pull request #545 from divdax/laravel-6
Laravel 6
2 parents eb17c7b + 9081b20 commit df09089

File tree

4 files changed

+14
-23
lines changed

4 files changed

+14
-23
lines changed

.scrutinizer.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,6 @@ filter:
99

1010
build:
1111
nodes:
12-
php71:
13-
environment:
14-
php:
15-
version: 7.1.3
16-
tests:
17-
override:
18-
- php-scrutinizer-run
19-
-
20-
command: vendor/bin/phpunit --coverage-clover=coverage71
21-
coverage:
22-
file: coverage71
23-
format: php-clover
2412
php72:
2513
environment:
2614
php:

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ env:
55
language: php
66

77
php:
8-
- 7.1
98
- 7.2
109

1110
before_script:

composer.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,16 @@
3939
}
4040
],
4141
"require": {
42-
"php": ">=7.1.3",
43-
"illuminate/console": "^5.8",
44-
"illuminate/database": "^5.8",
45-
"illuminate/filesystem": "^5.8"
42+
"php": ">=7.2",
43+
"illuminate/console": "^6.0",
44+
"illuminate/database": "^6.0",
45+
"illuminate/filesystem": "^6.0",
46+
"laravel/helpers": "^1.1"
4647
},
4748
"require-dev": {
48-
"phpunit/phpunit": "^7.5",
49+
"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)