Framework Detection
Data Helpers automatically detects which frameworks are available and enables appropriate integrations.
How It Works
Section titled “How It Works”Framework detection happens at runtime by checking for framework-specific classes:
// Laravel Detectionif (class_exists(\Illuminate\Support\Collection::class)) { // Enable Laravel Collection support}
// Doctrine Detectionif (class_exists(\Doctrine\Common\Collections\Collection::class)) { // Enable Doctrine Collection support}
// Symfony Detectionif (class_exists(\Symfony\Component\HttpFoundation\Request::class)) { // Enable Symfony Request support}Supported Frameworks
Section titled “Supported Frameworks”Laravel 9+
Section titled “Laravel 9+”Automatically detected features:
- Collections (
Illuminate\Support\Collection) - Eloquent Models (
Illuminate\Database\Eloquent\Model) - Service Provider auto-registration
- Controller dependency injection
Symfony 6+
Section titled “Symfony 6+”Automatically detected features:
- Collections (
Doctrine\Common\Collections\ArrayCollection) - Entities with Doctrine ORM
- Value Resolver for controllers
- Request data extraction
Doctrine 2+
Section titled “Doctrine 2+”Automatically detected features:
- Collections (
Doctrine\Common\Collections\Collection) - Entities with relationships
- Lazy loading support
Plain PHP
Section titled “Plain PHP”Works out of the box with:
- Arrays
- Objects
- JSON strings
- XML strings
Zero Configuration
Section titled “Zero Configuration”No configuration files or environment variables needed. Framework support is enabled automatically when the framework is present.
Benefits
Section titled “Benefits”- No Setup Required - Just install and use
- Framework Agnostic - Same API across all frameworks
- Optimal Performance - Only loads framework-specific code when needed
- Easy Testing - Works in any environment