New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

dutchcodingcompany/laravel-json-schema

Adds a service provider for json schemas
2,571
Install
composer require dutchcodingcompany/laravel-json-schema
Latest Version:3.1.0
PHP:^8.2
Laravel:11 · 12 · 13
Older releases:6 – 10
License:MIT
Last Updated:Jun 22, 2026
Links: GitHub  ·  Packagist
Maintainer: dododedodonl

Json Schema

Latest Version on Packagist Total Downloads

This package makes it easy to use swaggest/json-schema in laravel.

Installation

You can install the package via composer:

composer require dutchcodingcompany/laravel-json-schema

Usage

  1. Create a json schema in the schema directory, eg. storage/app/schema/example.json
  2. Reference the schema in the validator using one of the rules:
    • new \DutchCodingCompany\LaravelJsonSchema\Rules\JsonSchemaRule('example')
    • new \DutchCodingCompany\LaravelJsonSchema\Rules\JsonSchemaAttributeRule('type', TypeEnum::class) (be careful to validate the attribute type in this case)

To customize the schema directory, use environment variable JSON_SCHEMA_DIRECTORY or publish the config file.

License

The MIT License (MIT). Please see License File for more information.

Related Packages

hedronium/jables

Write your Laravel Database Schema in JSON.

105 78
dvrtech/schema-tools

Laravel package for JSON/CSV schema analysis and database structure generation

11,396 0
mesak/laravel-opis-validator

Laravel FormRequest With Opis Validator

5,001 1
cline/json-schema

Immutable JSON Schema implementation with support for drafts 2020-12, 2019-09, d...

1,253 0

Version History

Version Released PHP Laravel License
3.1.0 ^8.2 ^11.0 | ^12.0 | ^13.0 MIT
3.0.2 ^8.2 ^11.0 | ^12.0 MIT
3.0.1 ^8.2 ^11.0 | ^12.0 MIT
3.0.0 ^8.2 ^11.0 | ^12.0 MIT
2.2.3 ^8.2 ^11.0 | ^12.0 MIT