laravel-interfaces-and-di

v2026.09.24

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

GitHub
安装命令
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.

发现
标签

此技能尚未发布标签。

版本
最新版本元数据

版本

v2026.09.24

发布时间

2026年9月24日

分类

未分类

许可证

未指定

源路径

skills/laravel-interfaces-and-di

默认分支

main

最新提交

0002f35

Tree SHA

3db1f86