baks-dev/materials-catalog
Laravel/PHP module for managing a raw materials catalog. Install via Composer, compatible with PHP 8.4+. Includes PHPUnit test group for materials-catalog. MIT licensed.
Material, Category, Supplier).EventDispatcherInterface) won’t integrate with Laravel’s Events facade without a bridge.README lacks migration details. Risk: Table name collisions (e.g., materials vs. Laravel’s migrations table) or unsupported Doctrine features (e.g., custom types).| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Symfony-Laravel DI Conflict | Critical | Use abstract factories to decouple Symfony services. Example: |
| ```php | ||
| $this->app->bind( | ||
| \BaksDev\MaterialsCatalog\Service::class, | ||
| fn ($app) => new \BaksDev\MaterialsCatalog\Service( | ||
| $app->make(\Doctrine\ORM\EntityManagerInterface::class) | ||
| ) | ||
| ); | ||
| ``` | ||
| Doctrine-Eloquent Schema Divergence | High | Implement a schema adapter to translate Doctrine queries to Eloquent. |
| Event System Mismatch | Medium | Create a dual-event dispatcher or use Laravel’s bus to forward Symfony events. |
| Undocumented API Surface | High | Conduct a 1-week spike to map all public methods/classes. |
| PHP 8.4+ Dependency | Low | Laravel 10+ supports PHP 8.4; no major risk. |
| Localization (Russian README) | Medium | Translate critical docs; add English comments to core files. |
createMaterial) pass out-of-the-box?Laravel Compatibility Matrix:
| Laravel Feature | Symfony Package Support | Workaround |
|---|---|---|
| Eloquent ORM | ❌ (Doctrine) | Fork or use database views. |
| Service Providers | ❌ | Create a Laravel provider to wrap Symfony services. |
| Artisan Commands | ❌ | Expose via API or CLI wrapper. |
| Queue Workers | ❌ (Symfony Messenger) | Use Laravel queues to trigger Symfony jobs. |
| API Resources | ❌ | Build custom API resources to wrap package data. |
| Scout/Algolia | ❌ | Replace package search with Laravel Scout. |
| Horizon | ❌ | Monitor Symfony queues via external tool. |
| Blade Templates | ❌ | Use API responses or JSON:API for frontend. |
Dependency Alignment:
baks-dev/core:^7.4. Action: Verify this package is Laravel-compatible or replace its functionality (e.g., auth) with Laravel’s built-ins.composer.json.Discovery Phase (1 Week)
composer install in a Laravel app.Adapter Layer (2-3 Weeks)
// app/Providers/BaksDevServiceProvider.php
public function register()
{
$this->app->bind(
\BaksDev\MaterialsCatalog\Service::class,
fn ($app) => new \BaksDev\MaterialsCatalog\Service(
$app->make(\Doctrine\ORM\EntityManagerInterface::class)
)
);
}
// app/Facades/MaterialCatalog.php
public static function search(string $query): array
{
return app(\BaksDev\MaterialsCatalog\Service::class)->search($query);
}
// Listen to Symfony event in Laravel
SymfonyEventDispatcher::getInstance()->addListener(
MaterialUpdatedEvent::class,
fn ($event) => event(new \App\Events\MaterialUpdated($event->getMaterial()))
);
Database Integration (1-2 Weeks)
find() with where() clauses.Feature Parity (3-4 Weeks)
Resource classes.Optimization (1-2 Weeks)
How can I help you explore Laravel packages today?