- What is troydavisson/phrets used for?
- PHRETS is a PHP client library for connecting to RETS servers and pulling real estate data such as MLS listings, metadata, photos, and documents. It wraps the legacy RETS protocol in an object-oriented API so PHP applications can authenticate, search, and retrieve media without building raw protocol requests. In Laravel, it is best treated as an infrastructure gateway behind your own ListingFeed or MlsGateway interface.
- How do I install PHRETS with Composer?
- Install it with Composer using composer require troydavisson/phrets in your Laravel project. PHRETS is a plain PHP library, so Laravel will autoload it through Composer without requiring a Laravel-specific package. After installation, verify PHP extensions and pin the package version in composer.json before building your adapter.
- Is PHRETS compatible with Laravel?
- PHRETS is framework-agnostic and does not provide first-class Laravel support, service providers, or facades. It can run inside Laravel, but you should wrap it in an application-owned adapter and inject that adapter into queued jobs or services. Avoid calling RETS field names directly from controllers or Eloquent models.
- Which PHP versions and extensions does PHRETS require?
- PHRETS is a PHP library that typically depends on extensions such as curl, XML or DOM, and mbstring, but you should verify the exact requirements for the version you pin. Test on your target PHP version in CI, especially if you are on a newer Laravel release. Also check memory behavior when fetching large MLS result sets.
- How do I authenticate with a RETS server and store credentials securely?
- PHRETS connects to a RETS login URL using MLS-provided credentials and session handling, but authentication details vary by MLS vendor. Store credentials in Laravel environment variables or a secrets manager, never in source control. Define who owns MLS credentials and vendor escalation before moving beyond a sandbox.
- How do I search MLS listings and fetch metadata with PHRETS?
- You use PHRETS to log in, discover metadata, and issue RETS search queries against the appropriate classes and resources. Start with one MLS sandbox and prove metadata discovery before building incremental listing queries. Map RETS records into your own Property, Listing, and Media entities instead of leaking RETS field names into the domain.
- How do I download listing photos and documents from a RETS server?
- PHRETS can request objects such as listing photos and documents from a RETS server, but photo endpoints and limits differ by MLS. Persist media through Laravel Storage or S3 rather than storing binaries in your database. Add completeness checks and retention rules because photo availability and refresh behavior are vendor-specific.
- Should I run PHRETS imports in Laravel queues and how do I handle rate limits?
- Yes, long-running RETS pulls should run in Laravel queued jobs or scheduled commands, not user-facing requests. Use cache locks, checkpoints, idempotency, retries, and dead-letter handling around the PHRETS adapter. RETS servers are usually batch- or rate-limited, so respect MLS limits and implement backoff rather than scaling workers blindly.
- Is PHRETS still maintained and safe for production?
- PHRETS has moderate adoption but is community-driven, with no commercial SLA implied and a last release around July 2023. That is not automatically disqualifying, but you should pin the version, monitor package health, and keep a fork-or-patch contingency. Treat MLS-specific fixes, dependency updates, and protocol changes as ongoing ownership costs.
- How do I test PHRETS or migrate from RETS to RESO Web API?
- Test against an MLS sandbox first and add fixture-based tests around recorded RETS responses so CI does not depend on a live vendor. Keep PHRETS behind an interface so a future RESO Web API implementation can replace it without rewriting domain services. Ask the MLS about its RESO migration timeline and document an exit plan before RETS becomes deeply embedded.