flow-php/etl-adapter-json
Laravel-friendly adapter for Flow PHP ETL that reads and writes JSON data, enabling JSON files or streams to be used as ETL sources and destinations. Simple integration with pipelines for transforming and loading structured data.
ETL Pipeline Alignment: The flow-php/etl-adapter-json package is a JSON-specific ETL adapter, meaning it integrates with the broader FlowPHP ETL framework (a PHP-based ETL toolkit). If the product already uses FlowPHP for data transformation, this adapter provides a specialized JSON input/output handler for structured data processing (e.g., API responses, logs, or config files).
Laravel Compatibility:
map, filter, reduce).flow-php/etl (core ETL framework). If not already in use, adds ~10MB to vendor size.| Risk Area | Assessment | Mitigation Strategy |
|---|---|---|
| Dependency Bloat | Adds FlowPHP as a dependency; may introduce unused ETL features. | Scope integration to only JSON adapter + minimal FlowPHP core. |
| Laravel Abstraction | No native Laravel integration; requires custom glue code. | Build a thin Laravel wrapper (e.g., JsonEtlService) to abstract FlowPHP calls. |
| Performance | JSON parsing in PHP is slower than compiled languages (e.g., Go/Rust). | Benchmark against native Laravel JSON tools (json_decode, spatie/array-to-object). |
| Error Handling | FlowPHP’s error model may not align with Laravel’s exceptions. | Normalize exceptions (e.g., wrap Flow\Exception in JsonEtlException). |
| Maintenance | FlowPHP is low-activity (last release: ~2021). | Fork if critical bugs arise; monitor for upstream updates. |
spatie/array-to-object, nesbot/carbon (for JSON dates).symfony/serializer, jmespath.php/jmespath.php (for JSONPath queries).json_decode, manual loops).flow-php/etl + flow-php/etl-adapter-json.use Flow\ETL\Pipeline;
use Flow\ETL\Adapter\Json\JsonAdapter;
$pipeline = new Pipeline();
$pipeline->addAdapter(new JsonAdapter('input.json'))
->map(fn($item) => $item['transformed'])
->saveToJson('output.json');
namespace App\Services;
use Flow\ETL\Pipeline;
use Flow\ETL\Adapter\Json\JsonAdapter;
class JsonEtlService {
public function transform(string $inputPath, string $outputPath, callable $mapper) {
$pipeline = new Pipeline();
$pipeline->addAdapter(new JsonAdapter($inputPath))
->map($mapper)
->saveToJson($outputPath);
}
}
namespace App\Jobs;
use App\Services\JsonEtlService;
use Illuminate\Bus\Queueable;
class ProcessJsonJob {
use Queueable;
public function handle(JsonEtlService $etl) {
$etl->transform('large_file.json', 'processed.json', fn($item) => [...]);
}
}
flow-php/etl (check FlowPHP docs).justinrainbow/json-schema).composer.json to avoid breaking changes.JsonEtlService).Flow\ETL\Logger) for pipeline debugging.\Log::debug) for integration issues.json_decode + manual loops).SplFileObject for large files).symfony/serializerHow can I help you explore Laravel packages today?