Skip to content

Commit e106157

Browse files
committed
feat: add registerInstance
1 parent d4155bb commit e106157

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/ServiceProviders/HasRegisters.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,18 @@ protected function registerService(
174174
return $this;
175175
}
176176

177+
178+
protected function registerInstance(string $abstract, mixed $instance, string $alias = null): static
179+
{
180+
$this->app->instance($abstract, $instance);
181+
182+
if ($alias) {
183+
$this->app->alias($abstract, $alias);
184+
}
185+
186+
return $this;
187+
}
188+
177189
protected bool $runMigration = true;
178190

179191
public function ignoreMigrations(): void

0 commit comments

Comments
 (0)