Skip to content

Commit d7c3ce5

Browse files
Add proper links (#10706)
1 parent 5f01fbc commit d7c3ce5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

container.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ $this->app->singletonIf(Transistor::class, function (Application $app) {
178178
});
179179
```
180180

181+
<a name="singleton-attribute"></a>
182+
#### Singleton Attribute
183+
181184
Alternatively, you may mark an interface or class with the `#[Singleton]` attribute to indicate to the container that it should be resolved one time:
182185

183186
```php
@@ -217,6 +220,9 @@ $this->app->scopedIf(Transistor::class, function (Application $app) {
217220
});
218221
```
219222

223+
<a name="scoped-attribute"></a>
224+
#### Scoped Attribute
225+
220226
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:
221227

222228
```php
@@ -296,7 +302,7 @@ interface EventPusher
296302
}
297303
```
298304

299-
Furthermore, `Singleton` and `Scoped` attributes may be applied to indicate if the container bindings should be resolved once or once per request / job lifecycle:
305+
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:
300306

301307
```php
302308
use App\Services\RedisEventPusher;

0 commit comments

Comments
 (0)