*/ namespace Modules\MMFCustomersGroups\Http\Controllers; use Illuminate\Routing\Controller; use Modules\MMFCustomersGroups\Entities\CustomersGroup; class CustomersGroupsController extends Controller { public function list() { // Get the list of Mailboxes the current User is allowed to access. $user = auth()->user(); $mailboxes = $user->mailboxesIdsCanView(); // Get the list of Customers Groups, filtered by Mailbox. $groups = CustomersGroup ::whereIn('mailbox_id', $mailboxes) ->get(); return view('mmfcustomersgroups::groups/list', [ 'groups' => $groups, ]); } public function create() { // TODO } public function update() { // TODO } }