File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -287,6 +287,29 @@ public function siblings()
287
287
->where ($ this ->getParentIdName (), '= ' , $ this ->getParentId ());
288
288
}
289
289
290
+ /**
291
+ * Get the node siblings and the node itself.
292
+ *
293
+ * @return \Kalnoy\Nestedset\QueryBuilder
294
+ */
295
+ public function siblingsAndSelf ()
296
+ {
297
+ return $ this ->newScopedQuery ()
298
+ ->where ($ this ->getParentIdName (), '= ' , $ this ->getParentId ());
299
+ }
300
+
301
+ /**
302
+ * Get query for the node siblings and the node itself.
303
+ *
304
+ * @param array $columns
305
+ *
306
+ * @return \Illuminate\Database\Eloquent\Collection
307
+ */
308
+ public function getSiblingsAndSelf (array $ columns = [ '* ' ])
309
+ {
310
+ return $ this ->siblingsAndSelf ()->get ($ columns );
311
+ }
312
+
290
313
/**
291
314
* Get query for siblings after the node.
292
315
*
You can’t perform that action at this time.
0 commit comments