public function push(ViewableContract $viewable, $delay): bool
    {
        $namespaceKey = $this->createNamespaceKey($viewable);
        $viewableKey = $this->createViewableKey($viewable);

        $this->forgetExpiredViews($namespaceKey);

        if (! $this->has($viewableKey)) {
            $this->session->put($viewableKey, $this->createRecord($viewable, $delay));

            return true;
        }

        return false;
    }
public function push(ViewableContract $viewable, $delay): bool
    {
        $namespaceKey = $this->createNamespaceKey($viewable);
        $viewableKey = $this->createViewableKey($viewable);

        $this->forgetExpiredViews($namespaceKey);

        if (! $this->has($viewableKey)) {
            $this->session->put($viewableKey, $this->createRecord($viewable, $delay));

            return true;
        }

        return false;
    }
public function push ( ViewableContract $ viewable , $ delay ) : bool { $ namespaceKey = $ this -> createNamespaceKey ( $ viewable ) ; $ viewableKey = $ this -> createViewableKey ( $ viewable ) ; $ this -> forgetExpiredViews ( $ namespaceKey ) ; if ( ! $ this -> has ( $ viewableKey ) ) { $ this -> session -> put ( $ viewableKey , $ this -> createRecord ( $ viewable , $ delay ) ) ; return true ; } return false ; }
Push a viewable model with an expiry date to the session.

@param  \CyrildeWit\EloquentViewable\Contracts\Viewable  $viewable
@param  \DateTime  $expiryDateTime
Push a viewable model with an expiry date to the session .