File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -1182,13 +1182,14 @@ ideal in scenarios where you need to reduce the chance of duplicate records::
11821182 }
11831183 );
11841184
1185- .. versionadded :: 5.2.0
1186- Instead of a callback, the second argument can also be directly a data array ::
1185+ As of 5.2.0, you can provide an array of data to set into the entity when it is
1186+ created ::
11871187
1188- $record = $table->findOrCreate(
1189- ['email' => 'bobbi@example.com'],
1190- $otherData,
1191- );
1188+ $otherData = ['name' => 'bobbi'];
1189+ $record = $table->findOrCreate(
1190+ ['email' => 'bobbi@example.com'],
1191+ $otherData,
1192+ );
11921193
11931194If your find conditions require custom order, associations or conditions, then
11941195the ``$search `` parameter can be a callable or ``SelectQuery `` object. If you use
@@ -1201,6 +1202,9 @@ options for this method are:
12011202* ``defaults `` Set to ``false `` to not set ``$search `` properties into the
12021203 created entity.
12031204
1205+ .. versionadded :: 5.2.0
1206+ Support for ``$callback `` as an array of data was added.
1207+
12041208Creating with an existing primary key
12051209=====================================
12061210
You can’t perform that action at this time.
0 commit comments