freescout-customers-groups/Http/Controllers/CustomersGroupsController.php

37 lines
816 B
PHP
Raw Normal View History

<?php
/*
SPDX-License-Identifier: AGPL-3.0-only
SPDX-FileCopyrightText: © 2024 Millions Missing FRANCE <info@millionsmissing.fr>
*/
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
}
}