public function findByEntityId($entityId, $entityType)
    {
        $item = $this->model->where('entity_type', $entityType)->where('entity_id', $entityId)->first();

        if ($item && ($item->data->is_published == 1 || $item->data->is_published == 'on') && $item->data->published_at <= Carbon::now(config('app.timezone'))->format('Y-m-d H:i:s')) {
            return $item->data;
        }

        return null;
    }
public function findByEntityId($entityId, $entityType)
    {
        $item = $this->model->where('entity_type', $entityType)->where('entity_id', $entityId)->first();

        if ($item && ($item->data->is_published == 1 || $item->data->is_published == 'on') && $item->data->published_at <= Carbon::now(config('app.timezone'))->format('Y-m-d H:i:s')) {
            return $item->data;
        }

        return null;
    }
public function findByEntityId ( $ entityId , $ entityType ) { $ item = $ this -> model -> where ( 'entity_type' , $ entityType ) -> where ( 'entity_id' , $ entityId ) -> first ( ) ; if ( $ item && ( $ item -> data -> is_published == 1 || $ item -> data -> is_published == 'on' ) && $ item -> data -> published_at <= Carbon :: now ( config ( 'app.timezone' ) ) -> format ( 'Y-m-d H:i:s' ) ) { return $ item -> data ; } return null ; }
Find an entity by its Id

@param  integer $entityId
@param  string $entityType

@return Object|null
Find an entity by its Id