Hi.
Coming from Laravel, I have a list of discussions that I have filtered with a specific Eloquent query.
I would like to display it using the DiscussionListItem Mithril component. I cannot figure if I should use DiscussionRepository or something like it. I have tried without success :
import DiscussionListItem from 'flarum/forum/components/DiscussionListItem';
export default class {
view() {
return <div>some code...</div>
{ myData.discussions.map(discussion => m(DiscussionListItem, { discussion })) }
}
}
Server-side, the data is obtained with :
$discussions = Discussion::query()
->latest()
->take(12)
->with([
'user:id,username,avatar_url',
'tags:id,parent_id,name,slug,color,icon',
'lastPostedUser:id,username'
])
->get();