Skip to content

Commit

Permalink
Merge pull request #250 from n41tik/master
Browse files Browse the repository at this point in the history
Laravel 7.0 compatibility updates
  • Loading branch information
kodeine committed Apr 1, 2020
2 parents bd2628f + 328c4ad commit 0906171
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -20,11 +20,11 @@
],
"require": {
"php": ">=7.2",
"illuminate/support": "^6.0"
"illuminate/support": "^6.0|^7.0"
},
"require-dev": {
"phpunit/phpunit": "^8.0",
"orchestra/testbench": "^4.0",
"orchestra/testbench": "^4.0|^5.0",
"doctrine/dbal": "^2.9"
},
"autoload": {
Expand Down
12 changes: 12 additions & 0 deletions src/Kodeine/Acl/Models/Eloquent/Role.php
Expand Up @@ -2,6 +2,7 @@

namespace Kodeine\Acl\Models\Eloquent;

use DateTimeInterface;
use Illuminate\Database\Eloquent\Model;
use Kodeine\Acl\Traits\HasPermission;

Expand Down Expand Up @@ -30,6 +31,17 @@ public function __construct(array $attributes = [])
parent::__construct($attributes);
}

/**
* Prepare a date for array / JSON serialization.
*
* @param DateTimeInterface $date
* @return string
*/
protected function serializeDate(DateTimeInterface $date)
{
return $date->format('Y-m-d H:i:s');
}

/**
* Use the slug of the Role
* instead of the ID.
Expand Down

0 comments on commit 0906171

Please sign in to comment.