File tree 1 file changed +11
-4
lines changed
src/Jenssegers/Mongodb/Schema
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -114,13 +114,16 @@ public function dropIndex($columns = null)
114
114
* Specify a unique index for the collection.
115
115
*
116
116
* @param string|array $columns
117
+ * @param array $options
117
118
* @return Blueprint
118
119
*/
119
- public function unique ($ columns = null , $ name = null )
120
+ public function unique ($ columns = null , $ options = [] )
120
121
{
121
122
$ columns = $ this ->fluent ($ columns );
122
123
123
- $ this ->index ($ columns , ['unique ' => true ]);
124
+ $ options ['unique ' ] = true ;
125
+
126
+ $ this ->index ($ columns , $ options );
124
127
125
128
return $ this ;
126
129
}
@@ -144,12 +147,16 @@ public function background($columns = null)
144
147
* Specify a sparse index for the collection.
145
148
*
146
149
* @param string|array $columns
150
+ * @param array $options
147
151
* @return Blueprint
148
152
*/
149
- public function sparse ($ columns = null )
153
+ public function sparse ($ columns = null , $ options = [] )
150
154
{
151
155
$ columns = $ this ->fluent ($ columns );
152
- $ this ->index ($ columns , ['sparse ' => true ]);
156
+
157
+ $ options ['sparse ' ] = true ;
158
+
159
+ $ this ->index ($ columns , $ options );
153
160
154
161
return $ this ;
155
162
}
You can’t perform that action at this time.
0 commit comments