laravel-nestedset icon indicating copy to clipboard operation
laravel-nestedset copied to clipboard

Callback parameter when checking or fixing the tree

Open G3z opened this issue 4 years ago • 1 comments

I've added an optional callback to fixTree() countErrors() and relative methods so a user can configure the query

My main use case i to disable global scopes (I've added tests for this use case)

usage

Category::fixTree(function($query){
  $query->withoutGlobalScopes([AnUnwantedScope::class]);
});

Category::isBroken(function($query){
  $query->withoutGlobalScopes([AnUnwantedScope::class]);
});

G3z avatar Sep 29 '21 22:09 G3z