From 3da5df01277d29c1ce90ae212a817e9481b844f1 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Tue, 25 Apr 2023 11:50:55 -0700 Subject: [PATCH] Change from a standard Eloquent mapping for ID to a custom setRead --- app/Models/SnipeSCIMConfig.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Models/SnipeSCIMConfig.php b/app/Models/SnipeSCIMConfig.php index 77cbf01c1a..7ec25645e6 100644 --- a/app/Models/SnipeSCIMConfig.php +++ b/app/Models/SnipeSCIMConfig.php @@ -70,7 +70,11 @@ class SnipeSCIMConfig extends \ArieTimmerman\Laravel\SCIMServer\SCIMConfig // Map a SCIM attribute to an attribute of the object. 'mapping' => [ - 'id' => AttributeMapping::eloquent("id")->disableWrite(), + 'id' => (new AttributeMapping())->setRead( + function (&$object) { + return (string)$object->id; + } + )->disableWrite(), 'externalId' => AttributeMapping::eloquent('scim_externalid'), // FIXME - I have a PR that changes a lot of this. @@ -174,7 +178,6 @@ class SnipeSCIMConfig extends \ArieTimmerman\Laravel\SCIMServer\SCIMConfig '$ref' => null, 'display' => null, 'type' => null, - 'type' => null ]], 'entitlements' => null,