skills/noartem/skills/laravel-interfaces-and-di

laravel-interfaces-and-di

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.

Weekly Installs
12
Repository
noartem/skills
GitHub Stars
5
First Seen
Jan 30, 2026
Installed on
opencode11
cursor10
gemini-cli9
github-copilot9
codex9
kimi-cli9