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

Popo Laravel Package

scrumble-nl/popo

Popo is a Laravel package for generating plain old PHP objects (POPOs) from Eloquent models, giving you lightweight, framework-independent data containers that keep application layers clean and decoupled, with simple Artisan commands and an expressive API.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Popo
What is scrumble-nl/popo and what problem does it solve?
Popo is a lightweight Laravel package from Scrumble for working with Plain Old PHP Objects. It generates POPO classes from your Eloquent models so you can pass typed, structured data containers between your HTTP, service, and persistence layers instead of loose associative arrays. The goal is cleaner, more explicit data handling without pulling in a heavy abstraction or changing how routing, the container, or the ORM work.
How do I install scrumble-nl/popo in a Laravel application?
Install it with Composer using composer require scrumble-nl/popo. The package is Composer-ready and its service provider is auto-discovered, so there is no mandatory manual registration step. After installation you can use the provided Artisan commands to generate POPO classes; there is no infrastructure to provision and no migrations to run.
Which Laravel and PHP versions does popo support?
The 2.0.2 release notes publish a CI matrix covering Laravel 10 through 13 on PHP 8.1 through 8.5. That is a strong signal that the package is being kept compatible with current and upcoming PHP releases rather than left to drift. Check the composer.json constraints for the exact version you install, since the matrix reflects what CI tests rather than a guarantee for every patch combination.
How do I generate a POPO from an Eloquent model?
Popo ships Artisan generator commands that produce POPO classes derived from your Eloquent models. You run the command, review the generated class, and adjust it as your data shape evolves. Because generation is a one-off code-generation step, the resulting classes are ordinary PHP you own and can edit freely.
Are the generated POPOs framework-independent, or do they require Laravel?
The generator is Laravel-oriented and is intended to run inside a Laravel application. The objects it produces are plain PHP data containers, so the classes themselves carry no framework coupling and can be used in services, jobs, or listeners without dragging Laravel internals along. That separation is the main reason to use POPOs at layer boundaries.
Is popo a good alternative to Spatie Laravel Data or plain readonly classes?
It solves a similar boundary problem: replacing arrays with typed objects as data moves between layers. The difference is scope and philosophy, since popo focuses on generated POPO containers rather than a full data-transfer framework with validation, casting, and transformation built in. If your codebase already standardizes on Spatie Laravel Data or plain readonly classes, adding popo creates a second competing convention, so pick one and apply it consistently.
What changed in popo 2.0.2 and is it a breaking change?
Version 2.0.2 removes the laravel/helpers dependency and replaces snake_case() with Str::snake(), because laravel/helpers defines array_first() and array_last() with a two-argument signature that collides with PHP 8.5's native one-argument functions. No API changes are declared for that release. Be aware that dropping a global-function package can still break applications that relied on those helpers arriving transitively, so check your call sites if you upgrade. Also note that 2.0.2 is a patch on the 2.0 line; the 1.x to 2.x changelog should be read separately before a major upgrade.
Is scrumble-nl/popo actively maintained enough for production use?
The signs are encouraging: a recent release, a published CI matrix, and disciplined changelog entries suggest at least one engaged maintainer keeping pace with PHP 8.5. Adoption breadth is still thin, with roughly five stars and very few dependents, which means you will likely encounter edge cases before the wider community does. Treat the bus factor as one until proven otherwise, and pin the version in composer.json so an upstream change cannot surprise you.
Does popo require config publishing, a service provider, or migrations?
No migrations or database changes are involved, and the service provider is auto-discovered, so installation is essentially just the Composer require. Any optional configuration publishing, if present in your version, is not required for basic use. This low footprint is why the package is easy to trial in a single feature before rolling it out more broadly.
Where in a Laravel application should I use POPOs?
POPOs fit a conventional layering of FormRequest to POPO or DTO to Action or Service to Eloquent, where they give you type safety at the boundaries between those layers. They are most valuable where you already have a boundary problem: fat controllers, arrays passed between jobs and listeners, or queue payloads that need a stable shape. They fit poorly in codebases that are deliberately array-first, so introduce them where the pain is real rather than everywhere at once.
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.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource