You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> **Full Laravel Compatibility:** SmartCache implements Laravel's `Repository` interface, so it works seamlessly with any code that type-hints `Illuminate\Contracts\Cache\Repository`. The `store()` method returns a SmartCache instance that is also a valid Repository.
<strong>Note:</strong> The <code>store()</code> method returns a SmartCache instance, so all optimization strategies (compression, chunking, encryption, etc.) continue to work. Use <code>repository()</code> if you need direct access to Laravel's cache without SmartCache optimizations.
789
+
</div>
790
+
791
+
<divclass="alert alert-success">
792
+
<strong>Full Laravel Compatibility:</strong> SmartCache implements Laravel's <code>Illuminate\Contracts\Cache\Repository</code> interface, so it works seamlessly with any code that type-hints <code>Repository</code>. The <code>store()</code> method returns a SmartCache instance that is also a valid Repository, ensuring zero breaking changes when migrating from Laravel's Cache facade.
793
+
</div>
794
+
766
795
<h2>Automatic Optimization</h2>
767
796
<p>SmartCache automatically optimizes your data when beneficial:</p>
<p>Get a SmartCache instance for a specific cache driver. All SmartCache optimizations (compression, chunking, encryption, etc.) are preserved. The returned instance also implements <code>Illuminate\Contracts\Cache\Repository</code> for full Laravel compatibility.</p>
1748
+
<divclass="parameter">
1749
+
<spanclass="parameter-name">$name</span><spanclass="parameter-type">(string|null)</span> - The cache store name (redis, file, memcached, etc.)
1750
+
</div>
1751
+
<divclass="parameter">
1752
+
<spanclass="return-type">Returns:</span> static - SmartCache instance configured for the specified store (also implements Repository)
1753
+
</div>
1754
+
<divclass="example">
1755
+
<strong>Examples:</strong>
1756
+
<pre><codeclass="language-php">// Use Redis with all SmartCache optimizations
<strong>Note:</strong> Use <code>repository()</code> only when you need to bypass SmartCache optimizations. For normal usage, prefer <code>store()</code> to maintain all optimization benefits.
0 commit comments