Skip to content

ReportWidgets - which is correct way (more Winterish :D #805

Answered by WebVPF
SledgehammerPL asked this question in Q&A

You must be logged in to vote

More or less like this

use WebVPF\PlugName\Models\Member;

class MembersAtRisk extends ReportWidgetBase
{
    // ...

    protected function loadData()
    {

      $this->vars['members_list'] = Member::where('is_activated', true)->get();
    }
}

Here is an example with data from the Winter.User plugin: https://github.com/wintercms/wn-user-plugin/blob/7208cc1af5b8d5af6089eb4c08225c84547a0efd/reportwidgets/Statistics.php

Replies: 2 comments 2 replies

You must be logged in to vote
1 reply
@SledgehammerPL

Answer selected by SledgehammerPL

You must be logged in to vote
1 reply
@SledgehammerPL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants