laravel-interfaces-and-di

📁 noartem/laravel-vue-skills 📅 Jan 25, 2026
10
总安装量
10
周安装量
#29200
全站排名
安装命令
npx skills add https://github.com/noartem/laravel-vue-skills --skill laravel-interfaces-and-di

Agent 安装分布

codex 10
gemini-cli 8
opencode 8
amp 7
github-copilot 7
cursor 7

Skill 文档

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.