-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor and add importer to Installer module #443
- Loading branch information
Showing
37 changed files
with
1,208 additions
and
772 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
namespace App\Services; | ||
|
||
use App\Contracts\Service; | ||
use App\Models\Role; | ||
use App\Repositories\RoleRepository; | ||
|
||
class RoleService extends Service | ||
{ | ||
private $roleRepo; | ||
|
||
public function __construct(RoleRepository $roleRepo) | ||
{ | ||
$this->roleRepo = $roleRepo; | ||
} | ||
|
||
/** | ||
* Update a role with the given attributes | ||
* | ||
* @param Role $role | ||
* @param array $attrs | ||
* | ||
* @return Role | ||
*/ | ||
public function updateRole(Role $role, array $attrs) | ||
{ | ||
$role->update($attrs); | ||
$role->save(); | ||
|
||
return $role; | ||
} | ||
|
||
/** | ||
* @param Role $role | ||
* @param array $permissions | ||
*/ | ||
public function setPermissionsForRole(Role $role, array $permissions) | ||
{ | ||
// Update the permissions, filter out null/invalid values | ||
$perms = collect($permissions)->filter(static function ($v, $k) { | ||
return $v; | ||
}); | ||
|
||
$role->permissions()->sync($perms); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
/*/ | ||
!.gitignore | ||
!/Awards | ||
!/Importer | ||
!/Installer | ||
!/Sample | ||
!/Vacentral |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace Modules\Installer\Contracts; | ||
|
||
interface ImporterContract | ||
{ | ||
public function run(); | ||
} |
Oops, something went wrong.