app/Http/Controllers/ProductStockController.php
/**
     * Remove the specified resource from storage.
     *
     * @param ProductStock $productStock
     * @return JsonResponse
     */
Remove the specified resource from storage.
Remove the specified resource from storage .
public function destroy(ProductStock $productStock)
    {
        $productStockLog = ProductStockLog::query()->where('product_stock_id', '=', $productStock->id)->get();
        if ($productStock->delete()) {
            foreach ($productStockLog as $value) {
                $value->delete();
            }
            return Helper::response_with_data(null, false);
        }
        return Helper::response_with_data(null, true);
    }
public function destroy ( ProductStock $ productStock ) { $ productStockLog = ProductStockLog :: query ( ) -> where ( 'product_stock_id' , '=' , $ productStock -> id ) -> get ( ) ; if ( $ productStock -> delete ( ) ) { foreach ( $ productStockLog as $ value ) { $ value -> delete ( ) ; } return Helper :: response_with_data ( null , false ) ; } return Helper :: response_with_data ( null , true ) ; }
Remove the specified resource from storage.
Remove the specified resource from storage .