File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
src/Kodeine/Acl/Models/Eloquent Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 22
33namespace Kodeine \Acl \Models \Eloquent ;
44
5+ use DateTimeInterface ;
56use Illuminate \Database \Eloquent \Model ;
67use Kodeine \Acl \Traits \HasPermission ;
78
@@ -23,18 +24,24 @@ class Role extends Model
2324 */
2425 protected $ table ;
2526
26- protected $ dates = [
27- 'created_at:Y-m-d H:i:s ' ,
28- 'updated_at:Y-m-d H:i:s ' ,
29- ];
30-
3127 public function __construct (array $ attributes = [])
3228 {
3329 $ this ->table = config ('acl.db_prefix ' ) . 'roles ' ;
3430
3531 parent ::__construct ($ attributes );
3632 }
3733
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+
3845 /**
3946 * Use the slug of the Role
4047 * instead of the ID.
You can’t perform that action at this time.
0 commit comments