mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-19 01:46:03 +02:00
Add groups accounts fetching with dedicated route
This commit is contained in:
@@ -8,6 +8,7 @@ use App\Services\GroupService;
|
||||
use App\Http\Requests\GroupStoreRequest;
|
||||
use App\Http\Requests\GroupAssignRequest;
|
||||
use App\Http\Resources\GroupResource;
|
||||
use App\Http\Resources\TwoFAccountCollection;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class GroupController extends Controller
|
||||
@@ -109,6 +110,21 @@ class GroupController extends Controller
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get accounts assign to the group
|
||||
*
|
||||
* @param \App\Group $group
|
||||
* @return \App\Http\Resources\TwoFAccountCollection
|
||||
*/
|
||||
public function accounts(Group $group)
|
||||
{
|
||||
$groups = $this->groupService->getAccounts($group);
|
||||
|
||||
return new TwoFAccountCollection($groups);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
|
Reference in New Issue
Block a user