Skip to content

Commit

Permalink
simplify binding example
Browse files Browse the repository at this point in the history
  • Loading branch information
gwleuverink committed Aug 18, 2024
1 parent d409e93 commit 9fdd380
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,15 @@ namespace YourPackage;

use Illuminate\Support\ServiceProvider as BaseServiceProvider;
use Leuverink\AssetInjector\Contracts\AssetInjector;
use YourPackage\InjectAssets;

class ServiceProvider extends BaseServiceProvider
{
public function register()
{
$this->app->bind(
AssetInjector::class,
fn() => new \YourPackage\AssetInjector
InjectAssets::class
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protected function setUp(): void

$this->app->bind(
AssetInjector::class,
fn () => new Implement
Implement::class
);
}
}

0 comments on commit 9fdd380

Please sign in to comment.