This commit is contained in:
mahdi purHosseini
2024-02-11 12:21:01 +03:30
parent 87c4cf428f
commit 8f885f6888
3 changed files with 10 additions and 8 deletions
+4 -7
View File
@@ -173,13 +173,10 @@ class PackageController extends Controller
return MessageResponse::error( trans( 'messages.access_denied' ) );
}
if ( count( $Package->items ) ) {
foreach ( $Package->items as $itemId ) {
$item = Item::where( "id" , $itemId )->first();
if ( $item ) {
$item->update( [
"package_id" => null
] );
}
foreach ( $Package->items as $item ) {
$item->update( [
"package_id" => null
] );
}
}
if ( count( $Package->labels ) ) {