Skip to content

Commit 7480ed3

Browse files
authored
[Feature] Register inbound request instances as singletons (#590)
Closes #589
1 parent e922a9d commit 7480ed3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ServiceProvider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ protected function bindRouteRegistrar()
229229
*
230230
* @return void
231231
*/
232-
protected function bindInboundRequest()
232+
protected function bindInboundRequest(): void
233233
{
234234
$this->app->singleton(Route::class, function (Application $app) {
235235
return new Route(
@@ -238,15 +238,15 @@ protected function bindInboundRequest()
238238
);
239239
});
240240

241-
$this->app->bind(StoreInterface::class, function () {
241+
$this->app->singleton(StoreInterface::class, function () {
242242
return json_api()->getStore();
243243
});
244244

245-
$this->app->bind(ResolverInterface::class, function () {
245+
$this->app->singleton(ResolverInterface::class, function () {
246246
return json_api()->getResolver();
247247
});
248248

249-
$this->app->bind(ContainerInterface::class, function () {
249+
$this->app->singleton(ContainerInterface::class, function () {
250250
return json_api()->getContainer();
251251
});
252252

0 commit comments

Comments
 (0)