public function beingDeleted($payload)
    {
        $type = get_class($payload);
        $id = $payload->id;

        Translation::where('entity_id', $id)->where('entity_type', $type)->delete();
        Archive::where('entity_id', $id)->where('entity_type', $type)->delete();

        Archive::where('entity_type', 'Grafite\Cms\Models\Translation')
            ->where('entity_data', 'LIKE', '%"entity_id":'.$id.'%')
            ->where('entity_data', 'LIKE', '%"entity_type":"'.$type.'"%')
            ->delete();

        if ($type == 'Grafite\Cms\Models\Page') {
            Link::where('page_id', $id)->delete();
        }
    }
public function beingDeleted($payload)
    {
        $type = get_class($payload);
        $id = $payload->id;

        Translation::where('entity_id', $id)->where('entity_type', $type)->delete();
        Archive::where('entity_id', $id)->where('entity_type', $type)->delete();

        Archive::where('entity_type', 'Grafite\Cms\Models\Translation')
            ->where('entity_data', 'LIKE', '%"entity_id":'.$id.'%')
            ->where('entity_data', 'LIKE', '%"entity_type":"'.$type.'"%')
            ->delete();

        if ($type == 'Grafite\Cms\Models\Page') {
            Link::where('page_id', $id)->delete();
        }
    }
public function beingDeleted ( $ payload ) { $ type = get_class ( $ payload ) ; $ id = $ payload -> id ; Translation :: where ( 'entity_id' , $ id ) -> where ( 'entity_type' , $ type ) -> delete ( ) ; Archive :: where ( 'entity_id' , $ id ) -> where ( 'entity_type' , $ type ) -> delete ( ) ; Archive :: where ( 'entity_type' , 'Grafite\Cms\Models\Translation' ) -> where ( 'entity_data' , 'LIKE' , '%"entity_id":' . $ id . '%' ) -> where ( 'entity_data' , 'LIKE' , '%"entity_type":"' . $ type . '"%' ) -> delete ( ) ; if ( $ type == 'Grafite\Cms\Models\Page' ) { Link :: where ( 'page_id' , $ id ) -> delete ( ) ; } }
When the item is being deleted.

@param object $payload
When the item is being deleted .