Download the PHP package dolmatovdev/laravel-x12-parser without Composer

On this page you can find all versions of the php package dolmatovdev/laravel-x12-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-x12-parser

Laravel X12 Parser Package

License: MIT PHP Version Laravel Version

A comprehensive Laravel package for processing X12 files with validation, parsing, and JSON conversion capabilities. Built with clean architecture principles and optimized for maintainability.

Author: Danila Dolmatov (LinkedIn)

๐Ÿš€ Features

๐Ÿ“‹ Requirements

๐Ÿ“ฆ Installation

  1. Install via Composer:

  2. Publish Configuration (Optional):

  3. Publish Stubs (Optional):

๐Ÿ”ง Configuration

The package configuration is located in config/x12-parser.php:

๐ŸŽฏ Usage

Using the Facade

Using Dependency Injection

Using DTOs

Using Transaction-Specific Delimiters

Console Commands

The package provides several Artisan commands for X12 file processing:

Available Commands:

Using Custom File Naming

๐Ÿ“„ Supported Transaction Types

270 - Eligibility/Benefit Inquiry

The 270 transaction is used to inquire about a subscriber's eligibility and benefits.

Required Segments:

Optional Segments:

Sample 270 File:

๐Ÿงช Testing

Run the test suite:

Test Examples

๐Ÿ” Validation

The package provides comprehensive validation for ANSI files:

Validation Features:

Validation Result:

๐Ÿ—๏ธ Architecture

The package follows clean architecture principles with optimized code organization:

Key Architectural Improvements:

๐Ÿ”ง Extending the Package

Adding New Transaction Types

  1. Create Validator:

  2. Update Configuration:

The ValidatorFactory will automatically load the new validator from configuration.

๐Ÿ“š API Reference

AnsiParserService

Method Description
parseFile(string $filePath): array Parse ANSI file to array
parseFileToJson(string $filePath, bool $prettyPrint = true): string Parse ANSI file to JSON
buildFromJson(array $jsonData, string $transactionType = '270'): string Build ANSI from JSON
buildFrom270DTO(Eligibility270DTO $dto): string Build ANSI from DTO
saveToFile(string $content, string $filePath): bool Save content to file
buildAndSaveWithAutoName(array $jsonData, string $transactionType, array $data, ?string $customPattern, ?string $outputDirectory): string Build and save with auto-generated filename
generateFileName(string $transactionType, array $data, ?string $customPattern): string Generate filename for transaction type
getAvailablePlaceholders(): array Get available placeholders for file naming
resetSequence(): void Reset sequence counter
setSequence(int $sequence): void Set sequence counter
validateFile(string $filePath): ValidationResult Validate file
getSupportedTransactionTypes(): array Get supported types
isTransactionTypeSupported(string $transactionType): bool Check if transaction type is supported
getFileInfo(string $filePath): array Get file information without full parsing

Parser & X12Builder

Both classes use the HasDelimiters trait, providing these methods:

Method Description
setDelimitersForTransaction(string $transactionType): void Set delimiters from config
setDelimiters(array $delimiters): void Set custom delimiters
getDelimiters(): array Get current delimiters
getDefaultDelimiters(): array Get default delimiters

ValidationResult

Property Type Description
success bool Whether validation was successful
data array null Parsed data (if successful)
errors array Validation errors
warnings array Validation warnings
transactionType string null Detected transaction type

Eligibility270DTO

Property Type Description
subscriberId string Subscriber's unique identifier
subscriberFirstName string Subscriber's first name
subscriberLastName string Subscriber's last name
subscriberDateOfBirth string null Date of birth (YYYYMMDD)
subscriberGender string null Gender (M/F)
inquiries array Benefit inquiries

๐Ÿš€ Performance & Optimization

Recent Improvements:

Best Practices:

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

๐Ÿ“„ License

This package is open-sourced software licensed under the MIT License. See the LICENSE file for the full license text.

MIT License

License Summary

For more information about the MIT License, visit opensource.org/licenses/MIT.

๐Ÿ”— Links

๐Ÿ†˜ Support

For support, please open an issue on GitHub or contact Danila Dolmatov on LinkedIn.


All versions of laravel-x12-parser with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
laravel/framework Version ^10.0|^11.0
illuminate/support Version ^10.0|^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dolmatovdev/laravel-x12-parser contains the following files

Loading the files please wait ...