Download the PHP package dvrtech/schema-tools without Composer
On this page you can find all versions of the php package dvrtech/schema-tools. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package schema-tools
Schema Tools for Laravel
A comprehensive Laravel package for analyzing JSON/CSV data structures and automatically generating database schemas, migrations, and Eloquent models. Streamline your development workflow by converting raw data into production-ready Laravel components.
๐ Features
- Intelligent Data Analysis: Automatically analyze JSON and CSV data to determine optimal database column types
- Smart Type Detection: Context-aware type inference with intelligent type hierarchy (
json>text>varchar>date>decimal>float>int) - Database Structure Generation: Generate CREATE TABLE statements for MySQL and SQL Server
- Laravel Integration: Generate Laravel migrations and Eloquent models from raw data
- Type Compatibility: Intelligent type promotion and compatibility checking
- Azure Environment Support: Bidirectional conversion between Azure settings JSON and .env files
- Flexible Output: Support for various database types and output formats
- Production Ready: Comprehensive test coverage and static analysis
๐ Requirements
- PHP 8.1 or higher
- Laravel 9.0, 10.0, 11.0, or 12.0
๐ฆ Installation
Install the package via Composer:
The package will automatically register its service provider through Laravel's package auto-discovery.
๐ฏ Quick Start
Basic Usage
Artisan Commands
The package provides several Artisan commands for different use cases:
Schema Analysis
Migration Generation
Model Generation
Complete Resource Generation
Azure Environment Conversion
Convert between Azure settings JSON and Laravel .env files:
โ๏ธ Configuration
Publish the configuration file to customize default settings:
The configuration file (config/schema-tools.php) allows you to customize:
- Export Paths: Default locations for generated migrations and models
- Type Mappings: Custom database type mappings
- Naming Conventions: File and class naming patterns
Default Configuration
๐งช Testing
Run the test suite:
๐ง Advanced Usage
Programmatic API
Basic Schema Analysis
Generate Raw SQL Schema
Generate Laravel Migration
Generate Eloquent Model
Type Detection Logic
The package uses intelligent type detection with the following hierarchy:
- JSON/Arrays: Complex data structures โ
jsoncolumn type - Text: Long strings (>255 chars) โ
textcolumn type - VARCHAR: Short strings with dynamic length calculation โ
varchar(n) - Dates: Pattern-matched date strings โ
date/datetime - Decimal: Context-aware numeric detection (price, amount) โ
decimal(8,2) - Float: Decimal numbers โ
float - Integer: Whole numbers โ
int
Context-Aware Type Detection
The analyzer uses column name context to make intelligent type decisions:
๐ Data Format Support
JSON Files
Supports both single objects and arrays:
CSV Files
Automatically detects headers and analyzes data types:
๐ Azure Integration
Environment File Conversion
Convert between Azure App Service configuration and Laravel .env files:
๐๏ธ Architecture Overview
The package follows a clean architecture pattern:
- Services Layer: Core business logic (
SchemaAnalyzer,DatabaseSchemaGenerator) - Generators Layer: Code generation (
MigrationGenerator,ModelGenerator) - DTO Pattern: Structured data representation (
ColumnStructureDTO) - Console Commands: Artisan command interface
- Template System: File-based code generation templates
๐ค Contributing
We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Follow coding standards: Use PSR-12 coding standards
- Add tests: Ensure your changes are covered by tests
-
Run quality checks:
- Commit your changes: Use conventional commit messages
- Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
Development Setup
๐ Changelog
Please see CHANGELOG for more information on what has changed recently.
๐ก๏ธ Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
๐ License
The MIT License (MIT). Please see License File for more information.
๐ผ About DVRTech
This package is developed and maintained by DVRTech LLC.
๐ Credits
- DVRTech LLC - Initial development and maintenance
- Laravel Community - Inspiration and framework
- All Contributors - Thank you for your contributions!
Made with โค๏ธ by DVRTech
All versions of schema-tools with dependencies
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
illuminate/database Version ^9.0|^10.0|^11.0|^12.0
illuminate/console Version ^9.0|^10.0|^11.0|^12.0