Skip to content

Commit 20be4ac

Browse files
committed
fixed type error
1 parent 360de26 commit 20be4ac

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Database/Eloquent/FMEloquentBuilder.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public function setModel($model, $ids = [])
6363
*/
6464
public function exists()
6565
{
66-
6766
// do the query and check for a 401. The query will error if there are no rows which match the request
6867
try {
6968
$this->limit(1)->get();
@@ -198,7 +197,12 @@ public function createRecord()
198197

199198
// we always need to create the record, even if there are no regular or portal fields which have been set
200199
// forward this request to a base query builder to execute the create record request
201-
$response = $this->query->fieldData($fieldsToWrite->toArray())->portalData($model->portalData)->createRecord();
200+
$request = $this->query->fieldData($fieldsToWrite->toArray());
201+
if ($model->portalData) {
202+
$request->portalData($model->portalData);
203+
}
204+
205+
$response = $request->createRecord();
202206

203207
// Update the model's record ID from the response
204208
$recordId = $response['response']['recordId'];

0 commit comments

Comments
 (0)