src/http/controllers/HCBaseController.php
private function initializeDelete(string $id = null, bool $soft)
    {
        if ($id)
            $list = [$id];
        else
            $list = request()->input('list');

        if (sizeOf($list) <= 0)
            return HCLog::info('CORE-0004', trans('HCTranslations::core.nothing_to_delete'));

        DB::beginTransaction();

        try {
            if ($soft)
                $response = $this->__apiDestroy($list);
            else
                $response = $this->__apiForceDelete($list);
        } catch (\Exception $e) {
            DB::rollback();

            return HCLog::error('CORE-0005' . $e->getCode(), $e->getMessage());
        }

        DB::commit();

        if (isset($response))
            return $response;

        return ['success' => true, 'list' => $list];
    }
private function initializeDelete(string $id = null, bool $soft)
    {
        if ($id)
            $list = [$id];
        else
            $list = request()->input('list');

        if (sizeOf($list) <= 0)
            return HCLog::info('CORE-0004', trans('HCTranslations::core.nothing_to_delete'));

        DB::beginTransaction();

        try {
            if ($soft)
                $response = $this->__apiDestroy($list);
            else
                $response = $this->__apiForceDelete($list);
        } catch (\Exception $e) {
            DB::rollback();

            return HCLog::error('CORE-0005' . $e->getCode(), $e->getMessage());
        }

        DB::commit();

        if (isset($response))
            return $response;

        return ['success' => true, 'list' => $list];
    }
private function initializeDelete ( string $ id = null , bool $ soft ) { if ( $ id ) $ list = [ $ id ] ; else $ list = request ( ) -> input ( 'list' ) ; if ( sizeOf ( $ list ) <= 0 ) return HCLog :: info ( 'CORE-0004' , trans ( 'HCTranslations::core.nothing_to_delete' ) ) ; DB :: beginTransaction ( ) ; try { if ( $ soft ) $ response = $ this -> __apiDestroy ( $ list ) ; else $ response = $ this -> __apiForceDelete ( $ list ) ; } catch ( \ Exception $ e ) { DB :: rollback ( ) ; return HCLog :: error ( 'CORE-0005' . $ e -> getCode ( ) , $ e -> getMessage ( ) ) ; } DB :: commit ( ) ; if ( isset ( $ response ) ) return $ response ; return [ 'success' => true , 'list' => $ list ] ; }
Function which will actually call deletion function

@param string $id
@param bool $soft
@return array
@internal param $callback
Function which will actually call deletion function