Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Schema Laravel Package

krak/schema

krak/schema is a lightweight Laravel/PHP package for defining, validating, and managing application schemas. It provides a simple, framework-friendly API to keep schema logic organized, reusable, and easy to integrate into your project.

View on GitHub
Deep Wiki
Context7

Data Schema Declarations and Processing

Frequently asked questions about Schema
What is krak/schema used for in Laravel?
krak/schema provides a fluent, Laravel-native way to define and manage application schemas. It builds on Laravel's schema builder to make tables, columns, indexes, and relationships more expressive and readable as your data model grows. It also includes schema introspection helpers for inspecting existing structures. The package is positioned as a lightweight integration with no heavy configuration overhead.
How do I install krak/schema with Composer?
Install it as a Composer package, typically with composer require krak/schema. The package is PSR-4 and can be installed and exercised in isolation. Before adopting it, check its composer.json for PHP and Laravel constraints, because the release notes do not establish a verified version matrix. There is no first-party Laravel service provider implied, so any Laravel wiring remains your responsibility.
Does krak/schema support Laravel 10, 11, or 12?
The provided release notes do not establish PHP 8.1 through 8.3 or Laravel 10 through 12 support. The described test changes concern assertion fidelity, not a published version matrix. You should verify compatibility in composer require output and composer why before planning adoption. Treat runtime compatibility as unverified until you confirm it against your application's Laravel and PHP versions.
Is krak/schema a replacement for Laravel migrations?
krak/schema is described as building on Laravel's schema builder and providing migration-friendly syntax that fits naturally into Laravel projects. That makes it an expressive layer for declaring tables, columns, indexes, and relationships rather than a wholesale replacement for Laravel's migration system. You should still expect Laravel migrations to remain the mechanism that applies schema changes. The value is in cleaner, more readable schema declarations as the data model grows.
Can krak/schema validate Symfony config trees?
Version 0.2.0 references feature tests for Symfony config, which implies the schema layer can describe and round-trip Symfony Config component trees. That would mean the same declaration could drive configuration validation, not just request validation. However, this capability is currently evidenced only by test code, not by documentation or a stated public API. Treat it as promising but unproven for production until you inspect the source and tests.
What changed in krak/schema 0.2.0, and is it a breaking change?
Version 0.2.0 formalises a struct versus dict node distinction, representing fixed named shapes versus open map or dictionary nodes. The release replaces dict usage with struct rather than supporting both, and it is described as an explicit backward-compatibility break at 0.2.0. Because the break affects the core type vocabulary, existing schema declarations may need rewriting. There is no indication of a BC policy or deprecation shim, so budget for migration work.
Is krak/schema actively maintained and safe for production?
There is an active maintainer reshaping the type model, writing feature tests, and fixing fidelity bugs, which is better than a frozen package. However, one release after a long dormancy does not establish cadence, issue responsiveness, or downstream compatibility pressure. Dependents are still near zero, so there is little community bug-finding, and the 0.2.0 BC break shows willingness to change core vocabulary at minor versions. For production, pin versions, verify compatibility, and consider wrapping the package behind your own abstraction.
How does krak/schema compare to spatie/laravel-data or Laravel FormRequests?
Laravel FormRequests, validation rules, casts, and API Resources, along with spatie/laravel-data and Symfony Serializer, are primarily request and payload oriented. krak/schema positions itself as a declarative data-schema layer at the boundary between transport and domain logic. Its differentiated potential is a portable schema declaration that validates application or package configuration as well as inbound payloads. That config-tree use case is currently backed by test evidence rather than documentation, so compare it carefully with mature request-focused tools.
Do I need to register a service provider or publish configuration for krak/schema?
The technical assessment states that no first-party Laravel service provider is implied and that wiring remains your responsibility. The package is described as lightweight with no heavy configuration overhead. You should follow the repository README and source for exact integration steps rather than assuming Laravel package auto-discovery. If you need framework bindings, plan to add them in your application or a small adapter package.
How should I test a Laravel app that uses krak/schema?
Exercise your schema declarations in isolation and add feature tests that cover nested struct shapes, dictionary-style nodes, and round-trip validation or hydration. If you rely on the Symfony config integration, write your own tests for those config trees because the capability is currently evidenced mainly by the package's test code. Pin the package version and run your test suite against the Laravel and PHP versions you actually deploy. Also test upgrade paths carefully, since 0.2.0 introduced a core type-vocabulary break.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment