skills/noartem/laravel-vue-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
14
GitHub Stars
5
First Seen
Jan 25, 2026
Installed on
codex14
gemini-cli12
opencode12
amp11
github-copilot11
cursor11