src/BoomCMS/Http/Controllers/Page/Version.php
public function postEmbargo(Request $request, Page $page)
    {
        $this->authorize('publish', $page);

        $embargoedUntil = new DateTime('@'.time());

        if ($time = $request->input('embargoed_until')) {
            $timestamp = strtotime($time);
            $embargoedUntil->setTimestamp($timestamp);
        }

        $page->setEmbargoTime($embargoedUntil);

        $version = $page->getCurrentVersion();

        if ($version->isPublished()) {
            Event::fire(new Events\PageWasPublished($page, auth()->user(), $version));
        } elseif ($version->isEmbargoed()) {
            Event::fire(new Events\PageWasEmbargoed($page, auth()->user(), $version));
        }

        return $version->getStatus();
    }
public function postEmbargo(Request $request, Page $page)
    {
        $this->authorize('publish', $page);

        $embargoedUntil = new DateTime('@'.time());

        if ($time = $request->input('embargoed_until')) {
            $timestamp = strtotime($time);
            $embargoedUntil->setTimestamp($timestamp);
        }

        $page->setEmbargoTime($embargoedUntil);

        $version = $page->getCurrentVersion();

        if ($version->isPublished()) {
            Event::fire(new Events\PageWasPublished($page, auth()->user(), $version));
        } elseif ($version->isEmbargoed()) {
            Event::fire(new Events\PageWasEmbargoed($page, auth()->user(), $version));
        }

        return $version->getStatus();
    }
public function postEmbargo ( Request $ request , Page $ page ) { $ this -> authorize ( 'publish' , $ page ) ; $ embargoedUntil = new DateTime ( '@' . time ( ) ) ; if ( $ time = $ request -> input ( 'embargoed_until' ) ) { $ timestamp = strtotime ( $ time ) ; $ embargoedUntil -> setTimestamp ( $ timestamp ) ; } $ page -> setEmbargoTime ( $ embargoedUntil ) ; $ version = $ page -> getCurrentVersion ( ) ; if ( $ version -> isPublished ( ) ) { Event :: fire ( new Events \ PageWasPublished ( $ page , auth ( ) -> user ( ) , $ version ) ) ; } elseif ( $ version -> isEmbargoed ( ) ) { Event :: fire ( new Events \ PageWasEmbargoed ( $ page , auth ( ) -> user ( ) , $ version ) ) ; } return $ version -> getStatus ( ) ; }
Set an embargo time for the current drafts.

@param Request $request
@param Page    $page

@return string
Set an embargo time for the current drafts .