From 4cfce31a09c6a5dbeb3a7797dcbdad8b443c5147 Mon Sep 17 00:00:00 2001 From: Ahmed Alaa <92916738+AhmedAlaa4611@users.noreply.github.com> Date: Fri, 8 Aug 2025 00:46:03 +0300 Subject: [PATCH] Add proper links --- container.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/container.md b/container.md index 1a5de39735..c3682d1f95 100644 --- a/container.md +++ b/container.md @@ -178,6 +178,9 @@ $this->app->singletonIf(Transistor::class, function (Application $app) { }); ``` + +#### Singleton Attribute + Alternatively, you may mark an interface or class with the `#[Singleton]` attribute to indicate to the container that it should be resolved one time: ```php @@ -217,6 +220,9 @@ $this->app->scopedIf(Transistor::class, function (Application $app) { }); ``` + +#### Scoped Attribute + Alternatively, you may mark an interface or class with the `#[Scoped]` attribute to indicate to the container that it should be resolved one time within a given Laravel request / job lifecycle: ```php @@ -296,7 +302,7 @@ interface EventPusher } ``` -Furthermore, `Singleton` and `Scoped` attributes may be applied to indicate if the container bindings should be resolved once or once per request / job lifecycle: +Furthermore, [Singleton](#singleton-attribute) and [Scoped](#scoped-attribute) attributes may be applied to indicate if the container bindings should be resolved once or once per request / job lifecycle: ```php use App\Services\RedisEventPusher;