mcpField
L
laravel-interfaces-and-di

laravel-interfaces-and-di

github.com/noartemDevelopment1372 installsUpdated 3w ago
Repository

About laravel-interfaces-and-di

A Laravel development skill covering narrow interfaces and dependency injection. It guides developers in defining contracts, binding implementations in service providers, and making consumers easier to test or adapt.

Key features

  1. 01Define narrow interfaces
  2. 02Inject dependencies
  3. 03Bind implementations in providers
  4. 04Support mock-based testing
  5. 05Swap implementations without consumer changes

Use cases

  1. 01Isolating dependencies in tests
  2. 02Replacing an implementation behind a contract
  3. 03Clarifying service boundaries

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/noartem/skills --skill laravel-interfaces-and-di

After installing, type/laravel-interfaces-and-diin Claude Code to confirm it loaded.

Details

From the project README

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.

Comments

Markdown supported