If you are entering the if status but is not updating maybe you have the mysql server safe update mode, if you don't want to disable it, you can try something like this:
There must be a query with a join between orders and inventories (or whatever the table name is), then you would add a where like this ->where('orders.user_order_id', '=', DB::raw('inventories.user_id')) and then call ->delete()