Skip to content

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

Open
@apuatcfbd

Description

@apuatcfbd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions