- Can I use palepurple/propel1 in a Laravel 8/9 project?
- No, this package is **not** Laravel-compatible. Propel1 lacks Laravel’s Service Provider integration, Eloquent-like query builder, or migration system. You’d need a custom wrapper layer to adapt Propel’s static models (e.g., `UserPeer`) to Laravel’s conventions, which is complex and unsupported.
- What PHP versions does this Propel fork support?
- This fork supports PHP **5.3–7.4** with patches for PHP 7.2–7.4 compatibility (e.g., SQL injection fixes, `count()` fixes). PHP 8.x is **not supported** and may break due to upstream abandonment. Use at your own risk beyond PHP 7.4.
- How do I install palepurple/propel1 in a Laravel project?
- Run `composer require palepurple/propel1`, but **do not expect Laravel integration**. Propel1 uses XML schema files (`schema.xml`) and static `Peer` classes (e.g., `UserPeer`), which conflict with Laravel’s Eloquent models. You’ll need to manually configure database connections and manage schema separately.
- Does Propel1 work with Laravel’s migrations?
- No. Propel1 relies on **XML schema files** (`schema.xml`) and reverse-engineering tools, while Laravel uses PHP migrations. You’d need to manually sync changes between Propel’s schema and Laravel’s migration files, which is error-prone and unsupported.
- What are the main differences between Propel1 and Laravel’s Eloquent?
- Propel1 uses **static `Peer` classes** (e.g., `UserPeer::retrieveByPk($id)`) and a **Criteria API**, while Eloquent uses **fluent query builder** (e.g., `User::where('name', 'John')->get()`). Propel also lacks Eloquent’s dynamic relationships (e.g., `$user->posts`) and Laravel’s event system.
- Is palepurple/propel1 actively maintained?
- No. The last commit was in **2019**, and the fork is abandoned. The package only fixes PHP 7.x compatibility and Psalm docblocks. For new projects, consider **Eloquent, Doctrine ORM, or Propel 2.x** (if you need Propel features).
- Can I use Propel1’s code generation with Laravel?
- Technically yes, but it’s **not recommended**. Propel generates static `BaseModel` classes (e.g., `UserPeer`) that clash with Laravel’s autoloading and naming conventions. You’d need to rename classes and manually configure Propel’s schema to avoid conflicts.
- Are there performance issues with Propel1 in Laravel?
- Yes, indirectly. Propel1’s **static models and XML schema** add overhead to autoloading and CI/CD pipelines. Laravel’s Eloquent is optimized for modern PHP, while Propel1’s legacy design may slow down development and testing. Benchmark before committing.
- What’s the best alternative to Propel1 for Laravel?
- For **new Laravel projects**, use **Eloquent** (built into Laravel) or **Doctrine ORM**. If you need Propel’s features (e.g., nested sets, behaviors), consider **Propel 2.x** (though it’s also outdated) or **Doctrine DBAL** for low-level database access. Avoid Propel1 for new work.
- How do I test Propel1 models in Laravel’s testing environment?
- Testing is **complex** due to Propel’s static methods and global configuration. You’ll need to mock `Propel::getConnection()` and manually set up database fixtures. Laravel’s mocking tools (e.g., `Mockery`) won’t work seamlessly with Propel’s `Peer` classes. Consider wrapping Propel models in Laravel-compatible classes for easier testing.