app/Http/Controllers/EditGedcomRecordController.php
public function deleteFact(ServerRequestInterface $request, Tree $tree): ResponseInterface
    {
        $xref    = $request->get('xref', '');
        $fact_id = $request->get('fact_id');

        $record = GedcomRecord::getInstance($xref, $tree);

        Auth::checkRecordAccess($record, true);

        foreach ($record->facts() as $fact) {
            if ($fact->id() == $fact_id && $fact->canShow() && $fact->canEdit()) {
                $record->deleteFact($fact_id, true);
                break;
            }
        }

        return response();
    }
public function deleteFact(ServerRequestInterface $request, Tree $tree): ResponseInterface
    {
        $xref    = $request->get('xref', '');
        $fact_id = $request->get('fact_id');

        $record = GedcomRecord::getInstance($xref, $tree);

        Auth::checkRecordAccess($record, true);

        foreach ($record->facts() as $fact) {
            if ($fact->id() == $fact_id && $fact->canShow() && $fact->canEdit()) {
                $record->deleteFact($fact_id, true);
                break;
            }
        }

        return response();
    }
public function deleteFact ( ServerRequestInterface $ request , Tree $ tree ) : ResponseInterface { $ xref = $ request -> get ( 'xref' , '' ) ; $ fact_id = $ request -> get ( 'fact_id' ) ; $ record = GedcomRecord :: getInstance ( $ xref , $ tree ) ; Auth :: checkRecordAccess ( $ record , true ) ; foreach ( $ record -> facts ( ) as $ fact ) { if ( $ fact -> id ( ) == $ fact_id && $ fact -> canShow ( ) && $ fact -> canEdit ( ) ) { $ record -> deleteFact ( $ fact_id , true ) ; break ; } } return response ( ) ; }
Delete a fact.

@param ServerRequestInterface $request
@param Tree                   $tree

@return ResponseInterface
Delete a fact .