Skip to content

Commit

Permalink
fix: group seeder command
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelAndish committed May 18, 2024
1 parent b9ba07b commit 62ec058
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
![image](https://github.com/weprodev/LaraPanel/blob/master/src/Presentation/Panel/Stub/Public/logo.png)
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/weprodev/LaraPanel/master/src/Presentation/Panel/Stub/Public/logo.png" width="400" alt="LaraPanel Logo"></a></p>

<a href="https://packagist.org/packages/weprodev/larapanel"><img src="https://poser.pugx.org/laravel/framework/license.svg" alt="License"></a>
<p align="center">
<a href="https://packagist.org/packages/weprodev/larapanel"><img src="https://img.shields.io/packagist/v/weprodev/larapanel" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/weprodev/larapanel"><img src="https://img.shields.io/packagist/l/weprodev/larapanel" alt="License"></a>
</p>

# About LaraPanel

Expand Down
2 changes: 1 addition & 1 deletion src/Core/User/Repository/GroupRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function pluckAll(): Collection;

public function findById(int $groupId): GroupDomain;

public function findBy(array $attributes): GroupDomain;
public function findBy(array $attributes): ?GroupDomain;

public function delete(int $groupId): void;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,14 @@ public function findById(int $groupId): GroupDomain
return GroupFactory::fromEloquent($groupModel);
}

public function findBy(array $attributes): GroupDomain
public function findBy(array $attributes): ?GroupDomain
{
$groupModel = Group::where($attributes)->firstOrFail();
if ($groupModel = Group::where($attributes)->first()) {

return GroupFactory::fromEloquent($groupModel);
return GroupFactory::fromEloquent($groupModel);
}

return null;
}

public function delete(int $groupId): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function run(): void
if ($item['parent'] != null) {
$parent = $this->groupRepositoryInterface->findBy([
'name' => $item['name'],
])->getId();
])?->getId();
}

$findGroup = $this->groupRepositoryInterface->findBy([
Expand Down

0 comments on commit 62ec058

Please sign in to comment.