API for custom tag

Hi guys.

I want to generate a content-api route for a custom Tag, which returns a custom set of Entries, with pagination. Not sure if it's possible?

If not, how would be the "correct way" of creating a manuel api route to the Tag?

For instance if I make a controller, and a custom API route, and query for entries via Enttry::paginate(10) and return it – it returns the pagination object, but the data arrays are empty like this:

current_page: 1
data: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}]
0: {}
1: {}
2: {}
3: {}
4: {}
5: {}
6: {}
7: {}
8: {}
9: {}
first_page_url: "http://salt.loc/api/projects?page=1"
from: 1
last_page: 6
last_page_url: "http://salt.loc/api/projects?page=6"
links: [{url: null, label: "« Previous", active: false},…]
next_page_url: "http://salt.loc/api/projects?page=2"
path: "http://salt.loc/api/projects"
per_page: 10
prev_page_url: null
to: 10
total: 59
Answered by Marius Haugen!
>>>>>>> Answered <<<<<<<
3 Replies
2 Followers