Skip to content

Commit

Permalink
Fix Wrong Argument on impersonated
Browse files Browse the repository at this point in the history
  • Loading branch information
SupianIDz committed Apr 18, 2024
1 parent 37b5c33 commit 2d30732
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/Http/Resources/ImpersonateCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\ResourceCollection;
use Illuminate\Support\Collection;

class ImpersonateCollection extends ResourceCollection
{
Expand All @@ -15,7 +14,9 @@ class ImpersonateCollection extends ResourceCollection
public function toArray(Request $request) : array
{
return [
'data' => $this->collection->filter(fn($row) => app('impersonate.authorization')->isImpersonated($row))->values(),
'data' => $this->collection->filter(function (ImpersonateResource $row) {
return app('impersonate.authorization')->isImpersonated($row->resource);
})->values(),
];
}
}
4 changes: 2 additions & 2 deletions src/Http/Resources/ImpersonateResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
class ImpersonateResource extends JsonResource
{
/**
* @param Request $request
* @param Request|null $request
* @return array
*/
public function toArray( $request) : array
public function toArray($request) : array
{
return [
'key' => $this->getKey(),
Expand Down

0 comments on commit 2d30732

Please sign in to comment.