Skip to content

Commit

Permalink
fix resolveSubject static method
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed Feb 21, 2024
1 parent 2729e3b commit 0a785af
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Support/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -1441,16 +1441,15 @@ public static function resolveSubject(string $publicId)
{
$resourceMap = [
'store' => 'storefront:store',
'product' => 'storefront:store',
'order' => 'order',
'customer' => 'contact',
'contact' => 'contact',
'product' => 'storefront:product',
'order' => 'fleet-ops:order',
'customer' => 'fleet-ops:contact',
'contact' => 'fleet-ops:contact',
];

list($type) = explode('_', $publicId);

$modelNamespace = static::getMutationType($resourceMap[$type]);

if ($modelNamespace) {
return app($modelNamespace)->where('public_id', $publicId)->first();
}
Expand Down

0 comments on commit 0a785af

Please sign in to comment.