PHP code example of jn-devops / properties

1. Go to this page and download the library: Download jn-devops/properties library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jn-devops / properties example snippets


use Homeful\Properties\Models\Property;

$property = Property::create([
    'code' => 'PROP001',
    'name' => 'Sample Property',
    'type' => 'Residential',
    'cluster' => 'Cluster A',
    'phase' => 'Phase 1',
    'block' => 'Block 2',
    'lot' => 'Lot 5',
    'floor_area' => 60.0,
    'lot_area' => 80.0,
    'unit_type' => 'Townhouse',
]);

use Homeful\Properties\Models\Project;

$project = Project::create([
    'code' => 'PROJ001',
    'name' => 'Sunrise Estates',
    'location' => 'Sta. Rosa City, Laguna',
    'company_code' => 'RLI'
]);

$property->project()->associate($project);
$property->save();

use Homeful\Products\Models\Product;

$product = Product::create([
    'sku' => 'PROD123',
    'name' => 'Modern House Model'
]);

$property->product()->associate($product);
$property->save();

use Homeful\Properties\Data\PropertyData;

$propertyData = PropertyData::fromModel($property);