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
Interoperability

Interoperability Laravel Package

php-standard-library/interoperability

Interfaces for converting between PSL types and native PHP stdlib and intl equivalents, providing a consistent bridge so your code can move smoothly between PSL collections, strings, and other types and their built-in PHP counterparts.

View on GitHub
Deep Wiki
Context7

Interfaces for converting between PSL types and PHP stdlib/intl equivalents

Frequently asked questions about Interoperability
What is php-standard-library/interoperability used for?
It provides interfaces for converting between PSL types and native PHP stdlib or intl equivalents. The package contains only contracts, so you implement the actual converters. It is useful only when a project has already adopted PSL types and needs clean boundaries with native PHP.
Does this package work with Laravel out of the box?
No. Laravel is built on native PHP types and Symfony contracts, not PSL types, so there is no automatic integration. You would need to write converters and apply them wherever Laravel components expect native values. For most Laravel apps this creates unnecessary architectural overhead.
Do I need to install PSL to use these interfaces?
Yes, practically speaking. The interfaces describe conversions from PSL types, so you need PSL types in your domain for them to be meaningful. The interoperability package alone does not add PSL behavior or runtime conversions.
Does the package include converter implementations?
No, it only defines interfaces. Your team must implement each converter for the PSL types you use and maintain those implementations over time. That work includes handling edge cases in dates, numbers, strings, and intl-backed values.
Which PHP and Laravel versions are supported?
The interfaces themselves are lightweight and should work on PHP versions that support interfaces, but PSL itself may require PHP 8.1 or newer. You must verify that requirement against your Laravel version and deployment targets. There is no Laravel service provider or version-specific integration to rely on.
How do I integrate PSL types with Laravel Eloquent or collections?
Treat PSL as a bounded-context choice and convert to native PHP values at Laravel boundaries. For Eloquent, that usually means custom casts or mapping logic that converts PSL values before persistence and back after retrieval. Laravel collections should receive native arrays or values unless you deliberately wrap them.
Is this package production-ready and actively maintained?
The interfaces are simple and stable, but the package has minimal adoption and no dependent ecosystem. Maintenance of the converters falls entirely on your team, and community support is limited. Evaluate long-term support and PSL upgrade plans before using it in production.
What are the alternatives to using PSL interoperability in Laravel?
Most Laravel applications should use native PHP types, Laravel collections, Carbon, and the intl extension directly. Symfony contracts and Laravel contracts already cover many integration needs without a parallel type system. Only consider PSL interoperability if PSL provides measurable value in a specific domain.
How should I test converters between PSL and native PHP types?
Write unit tests for round-trip conversions and boundary values, including nulls, empty strings, locale-sensitive formatting, time zones, and numeric limits. Test both directions at the boundary where Laravel expects native values. Mocking is rarely needed because these converters should be pure and deterministic.
Can I use these interfaces with Symfony or Laravel contracts?
They are separate abstractions and do not replace Illuminate contracts or Symfony contracts. Using them alongside Laravel contracts can cause confusion and requires manual bindings in the service container. Keep PSL conversions isolated and avoid mixing them into general Laravel service contracts.
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.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings