- What is lyssal/entity used for?
- Lyssal Entity is a lightweight PHP entity manager for projects that need Doctrine-style entity handling without adopting a full ORM. It provides typed entities, collections, query building, and persistence helpers. It is useful for small applications or components where Eloquent or Doctrine would be heavier than necessary.
- How do I install lyssal/entity with Composer?
- Install it as a Composer dependency with composer require lyssal/entity. After installation, include Composer's autoloader in your PHP bootstrap or rely on Laravel's existing autoloading. Check Packagist for the available versions and PHP requirements before adding it to an existing project.
- Is lyssal/entity compatible with Laravel?
- Lyssal Entity is a general PHP package, so it can be installed in a Laravel application as a Composer dependency. It is not described as a Laravel-specific package, so verify its Composer constraints and test it against your Laravel version. For Laravel-native persistence, Eloquent may still be the simpler choice.
- Does lyssal/entity require Doctrine ORM?
- No, the package is presented as a lightweight alternative that brings Doctrine-style entity handling without requiring the full Doctrine ORM. It focuses on typed entities, collections, query building, and persistence helpers. If you need Doctrine's complete ORM feature set, use Doctrine directly instead.
- How do typed entities work in lyssal/entity?
- Typed entities let you model domain objects with explicit property types instead of relying on unstructured arrays. The package provides entity management functionality around those objects, including collections and query helpers. You define your entity classes and use the package's helpers to work with them consistently.
- How do collections and query building work in lyssal/entity?
- The package includes collection and query-building helpers for managing groups of entities and retrieving them with structured criteria. These helpers are intended to cover common lightweight use cases without the overhead of a full ORM query layer. Review the package source or documentation for the exact collection and query APIs, since repository details are not provided here.
- Can I use lyssal/entity for persistence without a full ORM?
- Yes, persistence helpers are part of the package's stated purpose, allowing simple entity persistence without a full ORM. This can reduce complexity for small projects that do not need migrations, identity maps, or advanced relationship management. You should still validate transaction handling, database support, and error behavior for your use case.
- How does lyssal/entity compare to Doctrine ORM or Eloquent?
- Lyssal Entity is much lighter than Doctrine ORM or Laravel Eloquent and focuses on typed entities, collections, query building, and persistence helpers. Doctrine and Eloquent provide broader ORM features such as relationships, migrations, events, and mature database tooling. Choose Lyssal Entity when those full ORM features are unnecessary, and choose Doctrine or Eloquent when you need them.
- Is lyssal/entity suitable for production applications?
- It can be suitable for small production projects where a full ORM is overkill, but you should assess maintenance activity, test coverage, PHP version support, and security before adopting it. Because repository details are not available in this context, pin the Composer version and run integration tests against your database. For critical systems, compare it with better-documented alternatives.
- How should I test entities managed by lyssal/entity?
- Use PHPUnit or your preferred test framework to cover entity property behavior, collection operations, query building, and persistence helpers. Keep database-backed tests isolated with a test database or fixtures, and assert that persistence helpers handle expected and failure cases correctly. Add integration tests in Laravel if you use the package inside a Laravel application.