laravel-interfaces-and-di

v2026.09.24

Use interfaces and dependency injection to decouple code; bind implementations in the container

GitHub
Install command
npx skhub add noartem/laravel-interfaces-and-di
Markdown
SKILL.md

Interfaces and Dependency Injection

Define narrow interfaces and inject them where needed. Bind concrete implementations in a service provider.

interface Slugger { public function slug(string $s): string; }

final class AsciiSlugger implements Slugger {
  public function slug(string $s): string { /* ... */ }
}

$this->app->bind(Slugger::class, AsciiSlugger::class);

Benefits: easier testing (mock interfaces), clearer contracts, swap implementations without touching consumers.

Discovery
Tags

No tags published for this skill.

Version
Latest version metadata

Version

v2026.09.24

Published

Sep 24, 2026

Category

Uncategorized

License

Not specified

Source path

skills/laravel-interfaces-and-di

Default branch

main

Latest commit

0002f35

Tree SHA

3db1f86