In my case, I have three tables:
-
type
- id
- type
- reason_id
-
reason
- id
- reason
-
permission
- id
- type_id
- reason_id (not sure has or not)
I expect that:
{
"message": "Get all permissions with type and reason",
"data": [
{
"id": "1",
"types": [
"id": "1",
"type": "Sick",
"reasons": [
"id": "1",
"reason": "covid-19"
]
]
}
2
Answers
in laravel try this: