Download the PHP package grazulex/laravel-modelschema without Composer

On this page you can find all versions of the php package grazulex/laravel-modelschema. 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-modelschema

Laravel ModelSchema

A foundational Laravel package for schema-driven development. Parse YAML schemas, generate insertable fragments for models, migrations, requests, resources, factories, seeders, controllers, tests, policies, observers, services, actions, and validation rules. Built to power Laravel TurboMaker, Arc, and other schema-based packages.

[![Latest Version](https://img.shi### Field Types & Extensions

Overview

Laravel ModelSchema provides schema parsing, validation, and fragment generation for Laravel applications. Instead of generating complete files, it produces insertable JSON/YAML fragments that parent applications can integrate into their own generation workflows.

๐ŸŽฏ Core Purpose: Enable schema-driven development with clean separation between core schema logic and application-specific generation.

๐Ÿš€ Key Features

  • ๐Ÿ” Schema Parsing & Validation - Parse YAML schemas with core/extension separation
  • ๐Ÿงฉ Fragment Generation - Generate insertable JSON/YAML fragments for Laravel artifacts
  • ๐Ÿ—๏ธ Clean Architecture - Separate core schema responsibilities from app-specific generation
  • ๐Ÿ”„ Multi-Generator Support - Models, Migrations, Requests, Resources, Factories, Seeders, Controllers, Tests, Policies, Observers, Services, Actions, Rules
  • ๐Ÿ“ˆ Schema Analysis - Advanced schema comparison, optimization, and performance analysis
  • ๐Ÿ”Œ Plugin System - Extensible field type plugins for custom functionality
  • ๐Ÿ“Š Integration API - Complete workflow for external packages (TurboMaker, Arc, etc.)
  • โœจ Extensible Design - Custom field types, generators, and validation rules

๏ฟฝ Installation

๐Ÿ—๏ธ Architecture

Core Services

  • SchemaService - Main API for parsing, validation, and core/extension separation
  • GenerationService - Coordinates all generators to produce insertable fragments
  • YamlOptimizationService - Advanced YAML parsing with lazy loading, streaming, and intelligent caching
  • SchemaDiffService - Advanced schema comparison and difference analysis
  • SchemaOptimizationService - Performance analysis and optimization recommendations
  • 13 Specialized Generators - Model, Migration, Request, Resource, Factory, Seeder, Controller, Test, Policy, Observer, Service, Action, Rule
  • FieldTypePluginManager - Manages extensible field type plugins for custom functionality

Schema Structure

The package uses a "core" structure to clearly separate core schema data from application extensions:

๐Ÿš€ Quick Start

1. Basic Schema Parsing

2. Complete Integration Workflow

3. Fragment-Based Generation

๐Ÿ—๏ธ Available Generators

Laravel ModelSchema provides 13 specialized generators, each producing insertable JSON/YAML fragments:

Core Laravel Components

Generator Description Output Fragment
Model Eloquent model with relationships, casts, and configurations model: {class_name, table, fields, relations, casts, ...}
Migration Database migration with fields, indexes, and foreign keys migration: {table, fields, indexes, foreign_keys, ...}
Request Form Request classes for validation (Store/Update) requests: {store: {...}, update: {...}}
Resource API Resource classes for data transformation resources: {main_resource: {...}, collection_resource: {...}}
Factory Model Factory for testing and seeding factory: {class_name, definition, states, ...}
Seeder Database Seeder for data population seeder: {class_name, model, count, relationships, ...}

Advanced Components

Generator Description Output Fragment
Controller API and Web Controllers with CRUD operations controllers: {api_controller: {...}, web_controller: {...}}
Test PHPUnit test classes (Feature and Unit) tests: {feature_tests: [...], unit_tests: [...]}
Policy Authorization Policy classes policies: {class_name, methods, gates, ...}

Business Logic Components (New in v2.0)

Generator Description Output Fragment
Observer Eloquent Observer with model event handlers observers: {class_name, events, methods, ...}
Service Business logic Service classes with CRUD operations services: {class_name, methods, dependencies, ...}
Action Single-responsibility Action classes actions: {crud_actions: [...], business_actions: [...]}
Rule Custom Validation Rule classes rules: {business_rules: [...], foreign_key_rules: [...]}

Usage Examples

๐Ÿ”ง API Reference

SchemaService

Method Description Returns
parseAndSeparateSchema() Parse YAML and separate core/extensions ['core' => array, 'extensions' => array]
validateCoreSchema() Validate only core schema section array (errors)
extractCoreContentForGeneration() Extract structured core data array
generateCompleteYamlFromStub() Generate complete YAML from stub string
getGenerationDataFromCompleteYaml() Extract all generation fragments array

GenerationService

Method Description Returns
generateAll() Generate all fragments for schema array
generateSingle() Generate single generator fragment array
getAvailableGenerators() List available generators array

๐Ÿ”Œ Trait-Based Field Type Plugin System

Laravel ModelSchema features an extensible plugin system using a trait-based architecture for custom field types. This modern approach provides powerful customization through traits and configuration objects.

Plugin Manager

Creating Custom Plugins with Traits

The new trait-based approach allows you to define field options through configuration arrays rather than hardcoded properties:

Trait-Based Custom Attributes System

The trait-based plugin system supports sophisticated custom attributes through configuration objects:

  • Type validation traits: string, int, boolean, array, etc.
  • Constraint traits: min, max, required, enum values
  • Default value traits: Automatically applied if not provided
  • Custom validator traits: Callback functions for complex validation logic
  • Transformation traits: Custom value transformation before storage
  • Integration traits: Seamlessly merged with Laravel's standard attributes

Advanced Trait Examples

๐Ÿ“– See Field Type Plugins Documentation for complete trait-based implementation guide.

๐Ÿ“ Example Schema Files

Basic User Schema

Blog Post Schema with Relations

๏ฟฝ Integration with Parent Applications

This package is designed to be consumed by larger Laravel packages like TurboMaker and Arc. Here's the typical integration pattern:

Parent Application Workflow

Fragment Structure

Each generator produces insertable fragments with this structure:

The parent application receives these fragments and inserts them into its own generation templates.

๐Ÿงช Testing

๐Ÿ”ง Requirements

  • PHP: ^8.3
  • Laravel: ^12.19 (optional, used in service provider)
  • Symfony YAML: ^7.3 (for YAML parsing)

๐Ÿ“š Documentation

Core Documentation

  • ๐Ÿ—๏ธ Architecture Guide - Understanding the package structure and design
  • ๏ฟฝ Migration Guide - Upgrading from previous versions
  • ๐Ÿ“Š Fragment Examples - Understanding generated fragments

Field Types & Extensions

  • ๏ฟฝ Field Types Guide - Complete field types reference
  • ๐Ÿ”Œ Field Type Plugins - Creating custom field type plugins
  • โœ… Custom Field Validation - Validating custom field types

Advanced Features

  • ๐Ÿ“ Logging System - Comprehensive logging and debugging
  • โšก Enhanced Features - Advanced capabilities overview
  • ๏ฟฝ YAML Optimization - High-performance YAML parsing with intelligent caching and streaming
  • ๏ฟฝ๐Ÿ” Schema Optimization - Schema analysis and optimization tools
  • ๐Ÿ”’ Security Features - Comprehensive security validation and protection

Integration Examples

  • ๐Ÿ”— Integration Example - Complete integration workflow
  • โœจ New Generators Example - Observer, Service, Action, Rule generators demo
  • ๐Ÿ› ๏ธ Schema Service API - API usage examples
  • ๐Ÿ“‹ API Extensions - Extended API implementations
  • ๐Ÿš€ YAML Optimization Examples - Performance optimization usage and examples
  • โšก Schema Optimization Usage - Advanced schema analysis examples
  • ๐Ÿ”’ Security Usage Examples - Security validation and protection examples

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

๐Ÿ”’ Security

Please review our Security Policy for reporting vulnerabilities.

๐Ÿ“„ License

Laravel ModelSchema is open-sourced software licensed under the MIT license.


Made with โค๏ธ by Jean-Marc Strauven (https://github.com/Grazulex)


All versions of laravel-modelschema with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/support Version ^12.0|^13.0
illuminate/contracts Version ^12.0|^13.0
nesbot/carbon Version ^3.10
symfony/yaml Version ^7.3
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 grazulex/laravel-modelschema contains the following files

Loading the files please wait ...