PHPackages                             rushing/laravel-data-schemas - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. rushing/laravel-data-schemas

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

rushing/laravel-data-schemas
============================

Generate JSON Schemas from Laravel Data objects with validation attributes

01.1k↓33.3%[1 issues](https://github.com/stephenr85/laravel-data-schemas/issues)PHP

Since Sep 30Pushed 7mo agoCompare

[ Source](https://github.com/stephenr85/laravel-data-schemas)[ Packagist](https://packagist.org/packages/rushing/laravel-data-schemas)[ RSS](/packages/rushing-laravel-data-schemas/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Data Schemas
====================

[](#laravel-data-schemas)

Generate JSON Schemas from Laravel Data objects with validation attributes.

This package automatically converts your [Spatie Laravel Data](https://github.com/spatie/laravel-data) objects into JSON Schema files, preserving validation rules, descriptions, and examples. Perfect for AI-powered applications, API documentation, and frontend validation.

Features
--------

[](#features)

- 🎯 **Single Source of Truth**: Define structure, validation, types, and schemas all in your Data objects
- 🔄 **Automatic Generation**: Run `schemas:generate` similar to `typescript:transform`
- 📝 **Rich Metadata**: Add descriptions and examples via custom attributes
- 🎨 **Flexible Output**: Configure path structure (namespace, flat, or custom)
- 🔌 **Extensible**: Custom collectors, generators, and path generators
- ✅ **Validation Mapping**: Automatic conversion of Spatie validation attributes to JSON Schema constraints

Installation
------------

[](#installation)

Install via Composer:

```
composer require rushing/laravel-data-schemas
```

Publish the configuration file (optional):

```
php artisan vendor:publish --tag=data-schemas-config
```

Usage
-----

[](#usage)

### 1. Add Attributes to Your Data Objects

[](#1-add-attributes-to-your-data-objects)

```
