Skip to content
Back to skills

Laravel Template Method And Plugins

ASecurity

Keep core flows stable; enable extension via small classes.

  • 67 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 10, 2026
ai-agentsgophp

Security analysis

A100/100

Scanned November 10, 2026

npx -y skills add ComeOnOliver/skillshub --skill laravel-template-method-and-plugins --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Laravel Template Method And Plugins?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Laravel Template Method And Plugins
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/comeonoliver-laravel-template-method-and-plugins/badge)](https://www.skillsdirectory.com/skills/comeonoliver-laravel-template-method-and-plugins)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Template Method and Pluggable Strategies

Keep core flows stable; enable extension via small classes.

## Template Method

Use a base class that defines the algorithm skeleton; subclasses override hooks.

```php
abstract class Importer {
    final public function handle(string $path): void {
        $rows = $this->load($path);
        $data = $this->normalize($rows);
        $this->validate($data);
        $this->save($data);
    }
    abstract protected function load(string $path): array;
    protected function normalize(array $rows): array { return $rows; }
    protected function validate(array $data): void {}
    abstract protected function save(array $data): void;
}
```

## Strategy/Plugin

Define an interface; register implementations; select by key/config.

```php
interface PaymentGateway { public function charge(int $cents, string $currency): string; }

final class StripeGateway implements PaymentGateway { /* ... */ }
final class BraintreeGateway implements PaymentGateway { /* ... */ }

final class PaymentsRegistry {
    /** @param array<string,PaymentGateway> $drivers */
    public function __construct(private array $drivers) {}
    public function for(string $key): PaymentGateway { return $this->drivers[$key]; }
}
```

Prefer adding a class over editing switch statements. Test implementations in isolation.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.