<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Offplan extends Model
{
    use HasFactory;

    protected $fillable = [
        'project_id',
        'developer_id',
        'unit_type_id',
        'development_status_id',
        'sale_status_id',
        'price',
        'unit_no',
        'floor',
        'view',
        'area',
        'unit_area',
        'beds',
        'completion_date',
        'parking',
        'added_by'
    ];

    public function project()
    {
        return $this->belongsTo('App\Models\Attribute', 'project_id');
    }

    public function sale_status()
    {
        return $this->belongsTo('App\Models\Attribute', 'sale_status_id');
    }

    public function development_status()
    {
        return $this->belongsTo('App\Models\Attribute', 'development_status_id');
    }

    public function unit_type()
    {
        return $this->belongsTo('App\Models\Attribute', 'unit_type_id');
    }

    public function developer()
    {
        return $this->belongsTo('App\Models\Attribute', 'developer_id');
    }
}
