Use Laravel's service container and type-hint dependencies instead of manually instantiating them: ```php final class CreateOrder { public function __construct(private OrderRepository $orders) {} } ``` Bind an interface to its implementation in `AppServiceProvider`: ```php $this->app->bind(OrderRepository::class, EloquentOrderRepository::class); ``` Then inject `CreateOrder` into the controller. Laravel resolves the dependency graph automatically, and the interface allows tests or deployments...
Scanned 9/5/2026
Install to Claude Code
npx -y skills add HoangNguyen0403/agent-skills-standard --skill laravel-architecture --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Laravel Architecture?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-laravel-architecture-f5a4319d)More formats (shields.io, HTML) on the badges page.
Use Laravel's service container and type-hint dependencies instead of manually instantiating them:
```php
final class CreateOrder
{
public function __construct(private OrderRepository $orders) {}
}
```
Bind an interface to its implementation in `AppServiceProvider`:
```php
$this->app->bind(OrderRepository::class, EloquentOrderRepository::class);
```
Then inject `CreateOrder` into the controller. Laravel resolves the dependency graph automatically, and the interface allows tests or deployments to swap implementations. Keep bindings centralized, use Form Requests for validation, and avoid `new EloquentOrderRepository()` or service-locator calls in application logic. If a dependency has no interface and no special construction, Laravel can autowire a concrete class directly.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!