How to fetch blogpost author to homepage controller

Hi, i’m trying to fetch authors name of any blogpost for home controller, but i cant. by the way, how can i fetch all users name ?

Hey @harun, welcome to our community. You mean a list of authors from all blogposts? How do you store them? In a users field?

$authors = $page->children()->pluck('authors', 'yaml', true);

would give you an array of authors stored in yaml format in an authors field.

Note that you have to replace $page with the parent page of your blogposts (unless your home page is the parent of these posts).