<?php

namespace App\Models;

use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

class CommReleaseDtl extends Model
{
    use SoftDeletes;

    protected $fillable = [
            'comm_id',
            'rcvd_id',
            'gl_id',
            'comm_amount',
            'agent_pcg_rate',
            'agent_com_rate',
            'um_pcg_rate',
            'um_com_rate',
            'broker_pcg_rate',
            'broker_com_rate',
            'ref_pcg_rate',
            'ref_com_rate',
            'payment_adv',
            'um_payment_adv',
            'tax',
            'remarks'
        ];

    protected $table = 'comm_release_details';

    public static function boot()
    {
        //parent::boot();
        //Developer::observe(new \App\Observers\UserActionsObserver);
    }

    public function property() {
        return $this->belongsTo(CommRelease::class, 'comm_id');
    }

    public function release() {
        return $this->belongsTo(CommRelease::class, 'gl_id');
    }

    /*public function agent() {
        return $this->belongsTo(Agent::class, 'agent_id');
    }

    public function property() {
        return $this->belongsTo(Property::class, 'property_id');
    }*/

    /*public function getTotalAmountAttribute()
    {
        return $this->commission->sum('release_amount');
        //return $this->release_amount;
    }*/


}
