created getAdmins function

This commit is contained in:
vedatakd 2020-10-14 16:59:17 +03:00
parent ec13fa7d96
commit 1d3fbda7f5
3 changed files with 26 additions and 1 deletions

View File

@ -4,7 +4,10 @@
"autoload": {
"psr-4": {
"Visiosoft\\ProfileModule\\": "src/"
}
},
"files": [
"src/Support/_helpers.php"
]
},
"require": {
"maatwebsite/excel": "*"

View File

@ -0,0 +1,12 @@
<?php namespace Visiosoft\ProfileModule\Support\Command;
use Anomaly\UsersModule\Role\Contract\RoleRepositoryInterface;
class getAdmins
{
public function handle()
{
$adminRole = app(RoleRepositoryInterface::class)->findBySlug('admin');
return $adminRole->getUsers();
}
}

View File

@ -0,0 +1,10 @@
<?php
use Visiosoft\ProfileModule\Support\Command\getAdmins;
if (!function_exists('get_admins'))
{
function getAdmins() {
return dispatch_now(new getAdmins());
}
}