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
Data Contracts

Data Contracts Laravel Package

survos/data-contracts

Survos Data Contracts provides a lightweight set of PHP interfaces and data contracts that standardize common data structures across Survos packages and Symfony applications, making it easy to share, swap and extend implementations while keeping code decoupled and consistent.

View on GitHub
Deep Wiki
Context7

Shared data vocabularies, content metadata, and item DTO contracts for Survos data/media/import packages.

Frequently asked questions about Data Contracts
What is survos/data-contracts used for?
It provides lightweight PHP contracts for modeling and exchanging data consistently across applications. The shared interfaces help decouple data producers from consumers so implementations can be swapped more easily. It is suitable for Laravel, Symfony, or standalone PHP projects.
How do I install survos/data-contracts with Composer?
Install it with Composer using composer require survos/data-contracts. Composer will resolve the package and add it to your project dependencies. Then use the provided interfaces through Composer autoloading in your application or package.
Does survos/data-contracts work with Laravel?
Yes, it can be used in Laravel applications as a normal Composer dependency. Because the contracts are framework-agnostic, they do not force Laravel-specific APIs into your data layer. You can implement the interfaces in Laravel services, jobs, or repositories while keeping the contracts reusable elsewhere.
Which Laravel versions are supported by survos/data-contracts?
The package is framework-agnostic, so Laravel compatibility is mainly determined by Composer's PHP version and dependency constraints rather than Laravel-specific version locks. Check the package composer.json requirements against your Laravel application runtime. This helps confirm compatibility before adding it to production.
What interfaces does survos/data-contracts provide?
The package provides shared contracts for data providers and consumers, standardizing how data is produced and exchanged across packages. The exact interface names and method signatures should be checked in the package source. The focus is intentionally on minimal, reusable contracts rather than concrete implementations.
Do I need Symfony to use survos/data-contracts?
No, the package is framework-agnostic and can be used with Laravel, Symfony, or standalone PHP. It is associated with Survos and Symfony-oriented packages, but the contracts themselves do not require the Symfony framework. You only need Composer autoloading to reference the interfaces.
How does survos/data-contracts help with testing?
It lets you depend on interfaces instead of concrete classes, making it easier to substitute test doubles or fake implementations. You can test data consumers in isolation without booting a full framework or external data source. This keeps unit tests fast and focused on behavior.
Can I swap implementations when using survos/data-contracts?
Yes, the main benefit of programming against shared contracts is that one implementation can be replaced by another as long as it satisfies the same interface. This helps when changing data sources, migrating services, or using different implementations in tests versus production. Consumers remain decoupled from the concrete provider.
How do I use survos/data-contracts in a standalone PHP project?
Require the package with Composer and implement its interfaces in your own classes. Because it is framework-agnostic, you can wire implementations manually or with any container you prefer. This is useful for libraries and services that need shared data contracts without depending on Laravel or Symfony.
Is survos/data-contracts a good alternative to custom data interfaces?
It can be a good fit when you want lightweight, reusable contracts instead of inventing your own interfaces across multiple packages. It encourages consistency and decoupling while keeping dependencies minimal. If your needs are highly specific, custom interfaces or broader data-mapping libraries may still be better, so review its actual interfaces and maintenance status.
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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console