Agent skill

laravel-interfaces-and-di

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

Stars 6
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/noartem/skills/tree/main/skills/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.

php
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.

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results