1 year ago

Is Cache class serialize the collection when it stored ?

Posted 1 year ago by hsntngr

I'm trying to cache my posts first time in laravel and I wanna ask something. Is laravel cache class serialize the collectin ? Or we have to serialize returning collection ?

$post_article = \Cache::remember("posts.$post->id." . app()->getLocale(), $minutes = "720", function () use ($post) {
            if (\Cache::has("posts.$post->id"))
                return \Cache::get("posts.$post->id." . app()->getLocale());
                return PostTranslation::getTransArticle($post->id, "review", "published")
                    ?? trans("posts.noDataAboutPost");

Please sign in or create an account to participate in this conversation.