You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Softdelete does not work properly in both methods "show" and "edit" of "TCG\Voyager\Http\Controllers\VoyagerBaseController". And interrupts adding scope to model.
....
// Use withTrashed() if model uses SoftDeletes and if toggle is selected
if ($model && in_array(SoftDeletes::class, class_uses_recursive($model))) {
$model = $model->withTrashed();
}
if ($dataType->scope && $dataType->scope != '' && method_exists($model, 'scope'.ucfirst($dataType->scope))) {
$model = $model->{$dataType->scope}();
}
...
$model = $model->withTrashed(); returns instance of "Illuminate\Database\Eloquent\Builder" instead of Model instance. As follows method_exists($model, 'scope'.ucfirst($dataType->scope) returns false. It should be as follows.
....
// Use withTrashed() if model uses SoftDeletes and if toggle is selected
if ($model && in_array(SoftDeletes::class, class_uses_recursive($model))) {
$model->withTrashed();
}
if ($dataType->scope && $dataType->scope != '' && method_exists($model, 'scope'.ucfirst($dataType->scope))) {
$model->{$dataType->scope}();
}
...
The text was updated successfully, but these errors were encountered:
This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.
Version information
Description
Softdelete does not work properly in both methods "show" and "edit" of "TCG\Voyager\Http\Controllers\VoyagerBaseController". And interrupts adding scope to model.
$model = $model->withTrashed();
returns instance of"Illuminate\Database\Eloquent\Builder"
instead of Model instance. As followsmethod_exists($model, 'scope'.ucfirst($dataType->scope)
returns false. It should be as follows.The text was updated successfully, but these errors were encountered: