RuslanJohnBell
4 months ago

Laravel resource route

Posted 4 months ago by RuslanJohnBell

Hi everyone

My laravel resource route return me response with empty fields, but in another resource route everything works fine.

This is my route list

|        | POST      | api/request/individual-craft                         | individual-craft.store   | App\Http\Controllers\[email protected]    | api          |
|        | GET|HEAD  | api/request/individual-craft                         | individual-craft.index   | App\Http\Controllers\[email protected]    | api          |
|        | GET|HEAD  | api/request/individual-craft/create                  | individual-craft.create  | App\Http\Controllers\[email protected]   | api          |
|        | PUT|PATCH | api/request/individual-craft/{individual_craft}      | individual-craft.update  | App\Http\Controllers\[email protected]   | api          |
|        | GET|HEAD  | api/request/individual-craft/{individual_craft}      | individual-craft.show    | App\Http\Controllers\[email protected]     | api          |
|        | DELETE    | api/request/individual-craft/{individual_craft}      | individual-craft.destroy | App\Http\Controllers\[email protected]  | api          |
|        | GET|HEAD  | api/request/individual-craft/{individual_craft}/edit | individual-craft.edit    | App\Http\Controllers\[email protected]     | api          |

In this route POST (storing item) and get all (indexing items) works fine

But if I try to get specific item via show method, using

api/request/individual-craft/{id}

it response me

{
"craft": [],
"links": [],
"attachments": []
}

In another resource route everything work fine

Please help

Please sign in or create an account to participate in this conversation.