Skip to content

Commit 0906171

Browse files
authored
Merge pull request #250 from n41tik/master
Laravel 7.0 compatibility updates
2 parents bd2628f + 328c4ad commit 0906171

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
],
2121
"require": {
2222
"php": ">=7.2",
23-
"illuminate/support": "^6.0"
23+
"illuminate/support": "^6.0|^7.0"
2424
},
2525
"require-dev": {
2626
"phpunit/phpunit": "^8.0",
27-
"orchestra/testbench": "^4.0",
27+
"orchestra/testbench": "^4.0|^5.0",
2828
"doctrine/dbal": "^2.9"
2929
},
3030
"autoload": {

src/Kodeine/Acl/Models/Eloquent/Role.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Kodeine\Acl\Models\Eloquent;
44

5+
use DateTimeInterface;
56
use Illuminate\Database\Eloquent\Model;
67
use Kodeine\Acl\Traits\HasPermission;
78

@@ -30,6 +31,17 @@ public function __construct(array $attributes = [])
3031
parent::__construct($attributes);
3132
}
3233

34+
/**
35+
* Prepare a date for array / JSON serialization.
36+
*
37+
* @param DateTimeInterface $date
38+
* @return string
39+
*/
40+
protected function serializeDate(DateTimeInterface $date)
41+
{
42+
return $date->format('Y-m-d H:i:s');
43+
}
44+
3345
/**
3446
* Use the slug of the Role
3547
* instead of the ID.

0 commit comments

Comments
 (0)