kodeine/laravel-acl

Different structure of data returned for JSON ($role->toJSON()) after cache expire

apuatcfbd opened this issue · 1 comments

I'm talking about JSON output/print
When cache is active, it return like the following for $role->getPermissions()

{
     role_name: {
         update: true
     },
     ...
}

but after the cache time exceeds, 1st response returns whole result set like:

[
	{
		"id":2,
		"inherit_id":null,
		"name":"role_name",
		"slug":{
			"update":true
		},
		"description":"Post can be edited",
		"created_at":"2021-03-03T12:02:43.000000Z",
		"updated_at":"2021-03-03T12:02:43.000000Z",
		"pivot":{
			...
		}
	},
	...
]

In config file I've 'cacheMinutes' => 1 & I get this type of data change every 1 minute.
Hope this explanation will be enough to reproduce the issue.

This makes working with this hard.

i'm actually traveling and cannot test this, can you please submit a PR if you were able to find a fix?