Download the PHP package jn-devops/products without Composer
On this page you can find all versions of the php package jn-devops/products. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jn-devops/products
More information about jn-devops/products
Files in jn-devops/products
Package products
Short Description Homeful Products Package
License MIT
Homepage https://github.com/jn-devops/products
Informations about the package products
๐ Homeful Products Package
This package is part of the Homeful ecosystem and represents a robust Eloquent-based product model for real estate or housing-related systems. It supports a wide range of property and product-related fields and implements the ProductInterface
.
๐ฆ Product Model Overview
The Product
model captures both core product identity and extended metadata such as property location, pricing, appraisal, and requirements using the SchemalessAttributes
via the meta
field.
โ Implements:
ProductInterface
- Supports price casting using
Whitecube\Price
- Configurable with Laravel's environment and configuration system
๐งฉ Traits Used
HasAdditionalAttributes
This trait defines metadata-backed accessors/mutators using the SchemalessAttributes
package. Key functionalities include:
๐ Property Metadata Fields
- Basic Fields:
market_segment
,location
,destinations
,directions
,amenities
,facade_url
- Property Info:
project_location
,project_code
,property_name
,phase
,block
,lot
- Dimensions:
lot_area
,floor_area
,project_address
- Structure:
property_type
,unit_type
,house_type
- Financials:
price
appraised_value
percent_down_payment
down_payment_term
percent_miscellaneous_fees
processing_fee
- Loan-Related:
balance_payment_interest_rate
balance_payment_term
mortgage_redemption_insurance_fee
income_requirement_multiplier
percent_gross_monthly_income
- Eligibility:
max_age
maximum_paying_age
- Status & Media:
status_code
key_location
digital_assets
phased_out
Each field is encapsulated via custom getXXXAttribute()
and setXXXAttribute()
accessors/mutators, backed by JSON metadata.
๐๏ธ Model Details
Key Properties
Property | Type | Source |
---|---|---|
sku |
string | Eloquent |
name |
string | Eloquent |
brand |
string | Eloquent |
category |
string | Eloquent |
description |
string | Eloquent |
price |
Price | casts via PriceCast |
appraised_value |
Price | meta |
percent_down_payment |
float | meta |
down_payment_term |
int | meta |
percent_miscellaneous_fees |
float | meta |
processing_fee |
float | meta or fallback |
phased_out |
bool | meta |
๐ฅ Config Defaults (config/products.php)
๐งช Tests
Functional Coverage:
- Asserts all core and meta attributes are working as expected
- Verifies casting and type correctness (e.g., Price, float, int, string)
- Confirms that
ProductData::fromModel()
transformation works - Tests
updateOrCreate()
and interface compliance
๐งฌ Data Transformation
ProductData
The ProductData
class maps the Product
model into a normalized, transport-ready DTO using Spatie Laravel Data:
Provides direct mapping to all relevant fields like:
sku
,name
,brand
,description
, etc.- Financial metrics and interest/multiplier values
- Metadata-rich project and unit identifiers
๐ Conclusion
This package bridges the static nature of database tables and the flexibility needed for real estate product customization. By leveraging SchemalessAttributes
, it ensures adaptability without schema bloat.
Behold, a new you awaits โ in housing, and in code. ๐กโจ
All versions of products with dependencies
illuminate/contracts Version ^10.0||^11.0
jn-devops/common Version ^1.1
spatie/laravel-data Version ^4.8
spatie/laravel-package-tools Version ^1.16